Y Fang wrote:
> Okay...I didn't know I could get chapters of this book for free. Thanks
> for the reference, I've read the sections 2.2.4 till 2.2.8
>
> However it still does not answer my question, of why the Images I'm
> producing seem to be 'attached' to the writer object and can't be passed
> around and used in any other methods, in the way an Image object
> produced by "Image image = Image.GetInstance("test.jpg") can be.
Please explain what's hard to understand in this fragment:
A content stream normally contains references to external objects,
images, and fonts. For example, you can find a reference to a font named
/F1 in listing 2.2. This font is stored elsewhere in the PDF file.
...
you should pass the reader object to the manipulation class (PdfStamper,
PdfCopy, or even PdfWriter) and ask the writer (not the reader!) for the
imported page. A PdfImportedPage object is returned. Behind the scenes,
all the necessary resources (such as images and fonts) are retrieved.
Your opinion is valuable because a second edition of the book is being
written as we speak!!!
> Is this implying that the Image produced by "Image image =
> Image.GetInstance(someImportedPage)" is not a real Image but merely an
> 'wrapped' PdfImportedPage?
Of course it is!
> But that's not really the case, because I
> tried modifying the code for method1 to return the PdfImportedPage
> instead of the Image, but still it seems what I'm returning is invalid
> (i.e. can't be used later on).
That is explained here: Behind the scenes, all the necessary resources
(such as images and fonts) are retrieved.
> Hence i'm hoping for a method that will not involve using the PdfWriter
> object of the document I'm actually writing to.
You don't understand the structure of a PDF file; you'd need to read the
complete book.
--
This answer is provided by 1T3XT BVBA
http://www.1t3xt.com/ - http://www.1t3xt.info
------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://www.1t3xt.com/docs/book.php
Check the site with examples before you ask questions:
http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/