Hello,
I'm a relatively new user of iText, and I'm very happy to have it
available. I'm running into an issue, however. I need to create a
document that has a rather large header. It is several lines long, and
it's displayed in a tabular format. I have this working using three
PdfPTables (yes, it's that complex with different column placements).
The header is 10 lines long. To make things more interesting, the
header on every page after the first doesn't need all 10 lines, only six
lines are to be shown.
My plan was to generate this header section as part of the Document
first just to get the layout right. Then I was going to move that code
into the onStartPage method so that the header would generate at the top
of every page. I was going to test the current page number to determine
which lines of the header I generate.
I've done some further reading in the iText book and other messages in
this forum, and I'm very concerned that my plans are going up in smoke.
It looks like headers should be generated in the onEndPage method
instead of onStartPage. I now have two major concerns.
First, as I generate body text of the document, I'd need to set the top
margin based on the page number. If I'm on page 1, I need 3.5 inches
for the header. Otherwise I need only 2 inches. Is it possible to call
Document.setMargins() in the onStartPage method to conditionally change
the top margin based on the current page?
Second, and this is the one that really concerns me, is it possible to
use the PdfPTable objects to generate my header data and make calls
document.add(table) to build the header? Or do I have to use the
PdfContentByte class and generate everything with absolute positions?
I'm afraid that the answer is that I have to use PdfContentByte, but I'm
hoping that's not the case since I already have everything working with
the PdfPTables.
Thanks so much for your help.
- Jeff
Confidentiality Notice: The information contained in this electronic
transmission is confidential and may be legally privileged. It is intended only
for the addressee(s) named above. If you are not an intended recipient, be
aware that any disclosure, copying, distribution or use of the information
contained in this transmission is prohibited and may be unlawful. If you have
received this transmission in error, please notify us by telephone (513)
229-5500 or by email ([email protected]). After replying, please erase it
from your computer system.
------------------------------------------------------------------------------
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image
processing features enabled. http://p.sf.net/sfu/kodak-com
_______________________________________________
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/