Working with Multipage Images in NSImage

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

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

However, I don't see NSTIFFImageRep, and the NSImageRep class doesn't seem to have anything to do with pages ...

ETA (in more detail to my question): How can I work with multipage TIFF? In C, I used a CGImageSource which allowed me to get the nth page. I don't see an equivalent for TIFF in object C.

thank.

+2


source to share


2 answers


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



+1


source


I'm not sure, but IIRC, if you initialize NSImage with multi-page TIFF data, you get one image per page. (Probably what peterb was talking about.)

Edit: Check out + [NSBitmapImageRep imageRepsWithData:] .



(via Apple Lists )

+1


source







All Articles