Rick Roen
Mon, 22 Sep 2008 15:50:40 -0700
I think you can do this with Ghostscript from the command line. Free too!
From: Rene Weiss [EMAIL PROTECTED]
Sent: Monday, September 22, 2008 4:24 AM
To: itext-questions@lists.sourceforge.net
Subject: [iText-questions] Extract whole Page as Image? (urgent)
Is it possible to extract a whole pdf page as image (jpg, tiff, .?) and save
it to the filesystem.
I tried to open the document with the pdf reader, and get an image of the
page, but I don't get the byte content of this Object.
Here is my code I tried.
PdfReader reader = new PdfReader("D:\\TEMP\\3980533.pdf");
Rectangle psize = reader.getPageSize(1);
float width = psize.getWidth();
float height = psize.getHeight();
Document document = new Document(new Rectangle(width, height));
PdfWriter writer = PdfWriter.getInstance(document,
new FileOutputStream("D:\\thumbnail.pdf"));
document.open();
System.out.println("Tampered? " + reader.isTampered());
pdfImportedPage page = writer.getImportedPage(reader, 1);
Image image = Image.getInstance(page);
byte[] imgOut = image.getOriginalData();
But I always get null for imgOut.
I tried image.getRawData() but it was the same result.
If there is a way to get the data out of the Image-Object, whats format of
this byte-array (jpg, tiff, .?).
Hopefully someone can help me, because it is really urgent to get the
"content as image".
Thank you very much, yours Rene Weiss
------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.1t3xt.com/docs/book.php