Hi there,

 

I'm trying to retrieve images in a pdf document created with Ghostscript
virtual printer.

 

In it, I'm able to retrieve in iText some streams, which I guess correspond
to the 4 images I see in Acrobat Reader when I open my pdf document.

Such streams have the entry /Flatedecode in the stream dictionary, but don't
have /Width, /Height, and other metadata for images.

 

I decode these streams with the following code

 

and then try to get image data with PdfImageObject, but get an exception
(since there are no other metadata in the stream dictionary)

 

PdfStream stream = (PdfStream) pdfobj;

                  

                  if (stream.get(PdfName.FILTER) != null

                             &&
stream.get(PdfName.FILTER).equals(PdfName.FLATEDECODE)) {

 

                        byte[] decodedBytes = PdfReader.FlateDecode(

                                   PdfReader.getStreamBytesRaw((PRStream)
stream), true);

                 }

PdfImageObject pio = new PdfImageObject((PRStream)stream);

 

 

Can somebody give me an advice?

 

Thank you

------------------------------------------------------------------------------
RSA® Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference 
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples: 
http://itextpdf.com/themes/keywords.php

Reply via email to