I have a PDF document that is created by creating NSImages with size in 72dpi pts, each has a single representation which is measured in pixels. I then put these images into PDFPages with initWithImage, and then save the document.
When I open the document, I need the resolution of the original image. However, all of the rectangles that PDFPage gives me are measured in points, not pixels.
I know that the information is in there, and I suppose I can try to parse the PDF data myself, by going through the voyeur.app example... but that's a WHOLE lot of effort to do something that should be pretty normal...
Is there an easier way to do this?
Added:
I've tried two techniques:
get the PDFRepresentation data from the page, and use it to make a new NSImage via initWithData. This works, however, the image has both size and pixel size in 72dpi.
Draw the PDFPage into a new off-screen context, and then get a CGImage from that. The problem is that when I'm making the context, it appears that I need to know the size in pixels already, which defeats part of the purpose...