Hi, 

 

After adding a template to my pdf file using iText I get the following error
when trying to read the file with Acrobat:

 

"An error exists on this page. Acrobat may not display the page correctly.
Please contact the person who created the PDF document to correct the
problem".

 

This error pops up after scrolling to the second page.  The template I added
is just some code to put "Page n of n" at the bottom of each page. If I
comment out the AddTemplate line the error goes away but so does my "Page n
of n " which I need to appear.

 

Here is the template code.

 

PdfTemplate template = pdfPageContents.CreateTemplate(560, 30); 

template.BeginText();

template.SetFontAndSize(baseFont, 8);

template.SetTextMatrix(400, 1);

template.ShowText("TerraMai Materials Bid " + BidNum + " - Page " + i + " of
" + reader.NumberOfPages);

template.EndText(); 

pdfPageContents.AddTemplate(template, 1, 5);

 

Again, if I comment out the last line I get no error but my page numbering
footer doesn't appear either. Can't figure out what this error means or why
it occurs. What's also strange is that the page appears fine. It looks just
they way I want it except for the annoying error message that pops up.

 

Any help is appreciated,

 

Thanks,

 

Damon

------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time, 
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
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/

Reply via email to