Hi all,

Since this is my first mail to this list, I wish my best congratulations and regards to Bruno Lowagie and Paulo Soares for their impressive work.

Now to the question:

I am developing a program to ensure that all my PDF documents have the same basic format. This format is very simple and it is consited of a Generic Cover-Page and a Generic Watermark. The Cover-Page and Watermark are both PDF files themselves. The Cover-Page is a one-page PDF document with some general instructions. It is appended to the very beginning of the document. The Watermark is a one-page PDF file with an image embedded. It is appended to the top-left corner of each page of the document. This Watermark PDF file has a small page size equal to the image itself.

Thanks to the fabulous iText API my program is already working and both addCoverPage and addWaterMark methods are fully-functional. That is, whenever I input some PDF file, my program correctly appends the Cover-Page and correctly inserts the Watermark in the over content of every subsequent page.

However, I with to add some intelligence to my program so that it is able to recognize whether some input document already has a Cover-Page or already has the Watermark. If it already has the Cover-Page, my program is only to insert the watermark. On the other hand, if all pages already have the watermark, my program is only to insert the cover-page. Finally, if the document has neither the cover-page nor any watermark, my program is to insert both contents.

How can I use iText to analyze any input document to check whether it already has some content? I don't want to end up with documents having more than one cover-pages. Also, if I added the watermark more than once, i know it would be placed over the same place, thus not being visible. However i'm sure the final object size would be larger than necessary.

I was thinking about having the methods addWatermark and addCoverPage insert some sort of invisible mark into the documents. This way, if i processed the document again this invisible mark could be retrieved and checked as a means to recognize this document were already processed.

Can any of you help me doing that using iText?

Thanks a lot!
 
Filipe Fedalto

Cansado dos disparates e despautérios da República?
Quer um basta nas desventuras de nossos governantes?
Acesse http://www.monarquia.org.br e http://www.brasilimperial.org.br
e saiba mais a respeito.

Reply via email to