Re: Anti-aliasing in Snow Leopard (10.6) PDFView
Re: Anti-aliasing in Snow Leopard (10.6) PDFView
- Subject: Re: Anti-aliasing in Snow Leopard (10.6) PDFView
- From: Keith Blount <email@hidden>
- Date: Thu, 4 Mar 2010 09:28:43 -0800 (PST)
Not sure if this is the same thing, but I recently ran into something similar - a scanned-in newspaper looked terrible and grainy in my app, although Preview handled it smoothly. The solution was to override -drawPage: in a PDFView subclass and set it to use high interpolation if anti-aliasing is turned on, as follows:
- (void)drawPage:(PDFPage *)pdfPage
{
[NSGraphicsContextsaveGraphicsState];
// Certain PDF files may appear very grainy (low quality) with the default image interpolation. If anti-aliasing is turned on, we therefore
// make interpolation high.
// NOTE: I got this fix from Skim.app's source code, so a credit to http://skim-app.sourceforge.net/ goes in the About box.
[[NSGraphicsContextcurrentContext] setImageInterpolation:([selfshouldAntiAlias] ? NSImageInterpolationHigh: NSImageInterpolationDefault)];
[super drawPage: pdfPage];
[NSGraphicsContextrestoreGraphicsState];
}
(As you can see from the code comments, the developers are Skim are the ones who came up with the solution, not me.)
I couldn't see much difference with the PDF you placed in Dropbox, but from the comparison image you posted it does look like the same thing.
Hope that helps.
All the best,
Keith
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden