Re: CGImage to NSImage, or PDFPage?
Re: CGImage to NSImage, or PDFPage?
- Subject: Re: CGImage to NSImage, or PDFPage?
- From: Brian Postow <email@hidden>
- Date: Wed, 11 Aug 2010 20:27:50 -0400
On Aug 11, 2010, at 2:03 PM, Rafael Cerioli wrote:
> Hi,
>
> Images are stored as "XObjects" in the PDF Stream. Either you can parse the stream yourself, or you use the Voyeur.app sample code, and you will get the image with its size.
>
Yeah, I was hoping there was a way to do it without doing that...
Using Voyeur, I was able to confirm that I am successfully putting the resolution INTO the PDF. The media box is correctly in pts, 612 x 792, and the images are correctly in pixels.
However, when I get the image OUT of the PDF, I lose the pixel data, only getting the media box size.
I've tried getting the image out in two ways:
one was to get the datarepresentation of the PDFPage, and then put that into an NSImage. The NSImage is 612x792 pixels.
The other is to draw the PDFPage into an offscreen graphics context. Unfortunately, in order for that to work correctly, I need to know the size of the image in pixels before hand!
Is there any way to get access to the xObjects in the PDFPage, other than parsing through the PDF data?
Brian Postow
Senior Software Engineer
Acordex Imaging Systems
_______________________________________________
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