views:

32

answers:

1

I have a bunch of NSImages that I'm keeping in a PDFDocument, as PDFPages. When I insert the NSImage the first time, the size of the NSImage is in points (72 dpi), and the size of the (only) NSImageRep is in pixels (200 dpi).

However, the NSImage that I get out of the PDFPage has 72 dpi for both image AND imagerep.

How do I recover my resolution when I go back to NSImage?

A: 
  1. There is a NSPDFImageRep class, you can use it (and push into the NSImage instance as a representation if necessary)
  2. Mac OS prior to 10.6 had next NSImage methods: isDataRetained, setDataRetained. If you are targeting 10.5, setDataRetained:YES will help you to avoid loosing source data when working with NSImage. According to help files, 10.6 always retains the data.

As for me, I'd recommend you to use the NSPDFImageRep class.

Gobra