Thanks very much for your reply.  I think I understand your points, but have
further questions.

On Wed, Jun 29, 2011 at 12:41 PM, 1T3XT BVBA <[email protected]> wrote:

> I can see the overlay (it's added as /Xi6, object number 1 in the PDF),
> but it's not in the "visible area".
> This is how you added it: q 1 0 0 1 0 0 cm /Xi6 Do Q
> You've used coordinate 0,0, but in this case you should have used
> 0,12407.1.
>
>
Yes, I'm using PdfContentByte.addTemplate (overlayPage, 0, 0).  So I'm
wrongfully assuming that the base document uses coordinates 0,0.  So I guess
what I'm hearing from you is that I have to first examine the base document,
get the x/y coords it's using, then do the math to know what to pass into
addTemplate().  Is this correct?

In order to find out the dictionary embedded in the base.pdf file I tried
running PdfContentReaderTool against it but it caused an exception:

C:\test-app>run-class com.lowagie.text.pdf.parser.PdfContentReaderTool
test\base.pdf
java.lang.ArrayIndexOutOfBoundsException: Invalid index: 02
        at
com.lowagie.text.pdf.CMapAwareDocumentFont.decodeSingleCID(Unknown Source)
        at com.lowagie.text.pdf.CMapAwareDocumentFont.decode(Unknown Source)
        at
com.lowagie.text.pdf.parser.PdfContentStreamProcessor.decode(Unknown Source)
        at
com.lowagie.text.pdf.parser.PdfContentStreamProcessor.displayPdfString(Unknown
Source)
        at
com.lowagie.text.pdf.parser.PdfContentStreamProcessor$ShowTextArray.invoke(Unknown
Source)
        at
com.lowagie.text.pdf.parser.PdfContentStreamProcessor.invokeOperator(Unknown
Source)
        at
com.lowagie.text.pdf.parser.PdfContentStreamProcessor.processContent(Unknown
Source)
        at
com.lowagie.text.pdf.parser.PdfTextExtractor.getTextFromPage(Unknown Source)
        at
com.lowagie.text.pdf.parser.PdfContentReaderTool.listContentStreamForPage(Unknown
Source)
        at
com.lowagie.text.pdf.parser.PdfContentReaderTool.listContentStream(Unknown
Source)
        at com.lowagie.text.pdf.parser.PdfContentReaderTool.main(Unknown
Source)

Although when I view the file in Acrobat or open it in other tools it opens
just fine.

So I guess my question is what iText library call do I want to use to check
the document's current x/y setting so I can do the calculation?  And if you
have any pointers on how this calculation is to be done, that would be
greatly helpful as well.

Thanks again for your help.

Jac
------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
iText-questions mailing list
[email protected]
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

Reply via email to