Search code examples
objective-ctiffnsimage

Working with multi-page images in an NSImage


I'm working on an image viewer application (OSX) and currently it can load and view images, but I need to be able to view multi-page PDFs and TIFFs. I'll have next/previous page buttons, etc.

Now, with PDF, I expect to use an NSPDFImageRep. This will let me set the current page and draw the current page etc.

However, I don't see an NSTIFFImageRep, and the NSImageRep class doesn't seem to have any way of dealing with pages...

ETA (more specifics on my question): How do I work with a multi-page TIFF? In C, I used a CGImageSource which let me get the nth page. I don't see an equivalent for TIFFs in objective C.

thanks.


Solution

  • I would expect that the easiest thing for you to do for a mixed PDF and TIFF viewer would be to make each non-PDF page a unique NSImageRep.