Re: Decoding images in PDF files
Re: Decoding images in PDF files
- Subject: Re: Decoding images in PDF files
- From: Scott Ribe <email@hidden>
- Date: Mon, 26 Aug 2013 12:09:42 -0600
On Aug 26, 2013, at 11:49 AM, Graham Cox <email@hidden> wrote:
> I have a question about extracting embedded bitmap images. When I encounter an XObject stream with subType /Image, I get a bunch of parameters that looks pretty close to the parameters to CGImageCreate. However, the 'Filter' parameter indicates /FlateDecode so I'm assuming that I can't just wrap the stream in a CFDataRef and then in a CFDataProvider - I'll need to actually decompress this data first using (according to PDF spec) zlib/deflate.
I can't answer your actual question, but I can tell you that going the other way, take a bitmap, feed it through the zlib library, write it into the stream works.
But watch out for the "predictor" value--if that's there, it means the stream is deltas instead of pixel values.
--
Scott Ribe
email@hidden
http://www.elevated-dev.com/
(303) 722-0567 voice
_______________________________________________
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