1T3XT info wrote:

>Stephan Trautmann wrote:
>> You talk about a reader object but in my case I just have the stamper,
>> the columntext and the contentbyte of the stamper something like:

>Hmm... it's impossible to create a PdfStamper object without a PdfReader 
>object, so... please rephrase your question.

Alright, maybe I should firstly introduce you to what I am about to do:
I got an existing pdf document having 3 form fields.
The task is to firstly fill these fields and add a large ( 660 rows) pdfptable 
starting at the first page to that document.
So far i managed to fill these fields by reading the existing pdfDocument, 
stamping the fields and adding the pdfptable to a columntext object to the 
first page.

Problem now:
the remaining content of my pdfptable is cut.

After adding the first part of the content by using the following snippet:

cb = stamper.getOverContent(pageCount);
ct = new ColumnText(cb);
ct.setAlignment(Element.ALIGN_CENTER);
ct.setSimpleColumn(36, 36, PageSize.A4.width()-36, PageSize.A4.height()-300);
ct.addElement(tableMainHeader);                                         
ct.go();

I added a subsequent page to go on adding the rest of the content...using the 
following snippet:

pageCount++;
stamper.insertPage(pageCount, PageSize.A4);
cb = stamper.getOverContent(pageCount);
ct = new ColumnText(cb);
ct.setAlignment(Element.ALIGN_CENTER);
ct.setSimpleColumn(36, 36, PageSize.A4.width()-36, PageSize.A4.height()-36);
ct.addElement(tableMainHeader);                                         
ct.go();

 but as soon as the second page is filled there are two remarkable problems:

1. the content, which has already been written to first page is suddenly lost
2. the content which is written to the second page starts at the first row of 
the table again although i thought that collumntext.go() erased the content 
from the object after rendering it.


>> I am not sure about the loop design although i think I should retrieve the 
>> "more text" information via 
>> int status = ct.go(true); (with which i have to add the content again 
>> afterwards)
>> 
>> I have read the pages in the book couple of time but i dun really get on 
>> with it as there is
>> no example where you work with the stamper object adding content to multiple 
>> pages starting
>> with a given first page.

>There is one somewhere in the mailing list archives.

>Also, what is the relation between your previous mail and this one?

It might be a bit confusing but the recent problem has already been solved by 
an answer of Mr. Lowagie and this last "problem" now is the subsequent one =)
By the way the reader object only returns a page count of 1 as only the first, 
already existing, page has been read. The reader doesn't reveal any information 
about how many pages the columntext object is going to need. ( which should be 
about 36 pages)

Therefore I got 2 questions now with regard to the problems:

1. why is the content of the first page erased as soon as the stamper adds a 
second page, although it had already been written?
2. i would like to get information for the loop design, because i tried 
something like p 201 and p209 in the book but nothing worked so far.

with kind regards

stephan 


______________________________________________________
GRATIS für alle WEB.DE-Nutzer: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://movieflat.web.de


------------------------------------------------------------------------------
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