Gatewood, Paul (RSIS) wrote:
> 1) When using the ColumnText object to display the long text, I am
> obviously not adding a new page correctly. Each time I call go(),
> as much of the remaining text as possible is written, but always
> to the same page (overprinting the previous text).
That's why all the ColumnText examples in the book call
document.newPage() after writing the final column.
With PdfStamper, you should insert new pages.
> 2) The pages added (of course I am not yet adding them successfully)
> include form fields (from page 5 of the template).
> These form fields appear on several pages of the template.
> What would be a good way to make sure the form
> fields on the added pages get filled (and flattened) as well?
I don't understand the question. What's the problem?
Have you tried flattening the form without success?
> Would it make sense to just defer filling/flattening initially,
> and after all the pages have been (successfully!) added, create
> a new stamper to fill and flatten all the fields
> (except for the one I am handling with the ColumnText object)?
Your description is too complex for me to understand.
I hope this is what you mean:
- fill all the fields except for the one on the last page.
- retrieve the coordinates of the field on the last page.
- add content using ColumnText on the last page
- repeat if there's more text {
- use insertPage to add a new page
- get the canvas of the (new, inserted) last page
- add content
}
This part is wrong:
> while ( ct.hasMoreText(status) ) {
> writer.newPage(); // insert a new page
> cb.addTemplate(sowPage,0,0); // add the static page as
> ct.setSimpleColumn(llx,lly,urx,ury);
> status = ct.go();
> }
You should insert a new page and get a new cb from that page.
br,
Bruno
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/