Op 12/04/2011 8:33, Robin Zhu schreef:
Hi, I would like to save the image into a file, from the image field
in one PDF.
part2.chapter08.ReplaceIcon told us how to replace the Icon of a push
button.
But how to get the existing icon? and save it into a jpg file?
Those who follow the list, know that I'm very sensitive regarding
questions that aren't phrased correctly.
Several aspects of your question are wrong:
1. You want to save the image form "the image field" in one PDF.
=> There is no such thing as an "image field" in a PDF. You are talking
about an annotation with an appearance. The closest you can get to an
"image field" is a "button field" with an icon.
2. You want to get the existing icon as a jpg file.
=> the icon of a button field can be a form XObject or an image XObject.
If it's a form XObject, then it's a "vector image" made up in PDF syntax
(as in the advertisement.pdf in the example). There's no way you can
extract this "image" as a jpg.
3. Suppose the icon is an Image XObject, what can you do?
=> If you have an image XObject, then you need to examine the annotation
at the lowest level. Once you have the stream object, you can get its
bytes and use Java's BufferedImage to create a JPG. Read part 4 of the
book to find out how to do this.
------------------------------------------------------------------------------
Forrester Wave Report - Recovery time is now measured in hours and minutes
not days. Key insights are discussed in the 2010 Forrester Wave Report as
part of an in-depth evaluation of disaster recovery service providers.
Forrester found the best-in-class provider in terms of services and vision.
Read this report now! http://p.sf.net/sfu/ibm-webcastpromo
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
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