Petter Nyström wrote:

Could someone give me a quick read-up on how iText does its stuff behind the scenes? I think that'd be crucial understanding for me if I am going to use iText to do my work.

Forgive me for not answering all the questions at once.
Let's do this step by step. First download the iText Toolbox:
http://www.lowagie.com/iText/itext.jnlp

Open Tools->TreeViewPdf
A child window will open.
Then enter the path to your PDF as an Argument.

You will get a TreeView inside the PDF.
Open the PageTree Dictionary.
You will find one or more Pagesnode.
Open Page 0, if it has images, you will find
them in the /Resources under /XObject
(you'll have to open several nodes, before you find them).

You'll find something like /img0 Dictionary of type /XObject.
The TreeViewPdf tool doesn't go any further, but you can use
the code of this plug-in to write an app that gets the dictionary
with the Image XObject (and the image stream).
If you change dictionary entries of objects retrieved from PdfReader
you can create a PdfStamper with this altered reader object to
produce a new PDF. You will need the PDF Reference to know
how all the PDF objects and dictionary entries fit together; it's not
particularly easy stuff. There must be other libraries around that
will cost you less time to replace an image.

But if you insist on using iText, then this is a first step.
I don't know if it will lead to a solution; but it will certainly help
you understand how PDF works.
best regards,
Bruno

--
Don't forget to answer the question: would you buy a book on iText?
http://jroller.com/page/blowagie?entry=would_you_buy_a_book


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to