• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSImage and zooming PDFs vs. bitmaps
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSImage and zooming PDFs vs. bitmaps


  • Subject: Re: NSImage and zooming PDFs vs. bitmaps
  • From: "Adam R. Maxwell" <email@hidden>
  • Date: Tue, 12 Aug 2008 11:38:26 -0700

On Tuesday, August 12, 2008, at 11:09AM, "Ken Ferry" <email@hidden> wrote:
>Okay, thanks Hamish.  This area is getting some love for SnowLeopard.
>I suspect that all these issues except for the one about opting not to
>make large caches are already fixed. NSImage should be something that
>(a) does things you want, (b) does things you understand.
>
>As far as options, NSPDFImageRep and NSEPSImageRep themselves do not
>do any raster caching, so you could use them and do anything else you
>need on top.  There are also other system APIs such as CGPDFDocument
>and PDFKit.

FWIW, I ran into some of these problems a while ago and didn't file bug reports since I figured NSImage behaved that way by design!  Anyway, I decided to avoid NSImage entirely and ended up using an object that draws the PDF as a rasterized CGImage when scrolling or at low magnification, and draws a CGPDFPage at high magnification levels.  It works fairly well, although I had to cache bitmaps to disk for the large number of files I was looking at, in order to keep memory usage down.

Source (BSD license) for that class is at http://code.google.com/p/fileview/source/browse/trunk/fileview/FVPDFIcon.m.  Most of the complexity is due to my threading/caching scheme, but drawing takes place in drawInRect:ofContext:, and I suspect you might be able to do something similar with Core Animation.

--
Adam
_______________________________________________

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

References: 
 >NSImage and zooming PDFs vs. bitmaps (From: Hamish Sanderson <email@hidden>)
 >Re: NSImage and zooming PDFs vs. bitmaps (From: "Ken Ferry" <email@hidden>)
 >Re: NSImage and zooming PDFs vs. bitmaps (From: Hamish Sanderson <email@hidden>)
 >Re: NSImage and zooming PDFs vs. bitmaps (From: Ken Ferry <email@hidden>)
 >Re: NSImage and zooming PDFs vs. bitmaps (From: Hamish Sanderson <email@hidden>)
 >Re: NSImage and zooming PDFs vs. bitmaps (From: "Ken Ferry" <email@hidden>)

  • Prev by Date: Re: Get specified window from nib
  • Next by Date: Re: Accessing memory of another application?
  • Previous by thread: Re: NSImage and zooming PDFs vs. bitmaps
  • Next by thread: Re: xcode difficulty
  • Index(es):
    • Date
    • Thread