Hi Charlie,
I think it's possible to let iText do the splitting work automatically,
but I don't know if it's the best way.
Couldn't you just call Document.newPage() after adding a complete data set
to the document?
For doing the newPage automatically you have to add a Chunk with
GenericTag as last element of a data set. When the element with the
GenericTag is added to the document the onGenericTag method of the event
class is called. There you can do whatever should happen after adding a
complete data set e.g. goto a new page.
GenericTag example:
http://stderr.org/doc/libitext-java-doc/www/tutorial/ch12.html
Best Regards
Benjamin
"Charles Mason" <[email protected]>
12.01.2009 13:07
Bitte antworten an
[email protected]; Bitte antworten an
Post all your questions about iText here
<[email protected]>
An
[email protected]
Kopie
Thema
[iText-questions] Controling Automatic Page Breaking
Hi All,
I have a web app which generates a fairly simple PDF from a DB.
Basicaly the PDF has a series of data sets, each on is represented in
the PDF by a Title, description paragraph, table of the data and an
advise paragraph. These take about an average of a third of an A4
page. The data sets vary in size and so can the length of the text
paragraphs, so its not easy to predict how much room they will take
up.
At present when the bottom of the page is reached iText just wraps on
to another page, so it may end a page with a title of the next data
set. Is there a way to tell iText, it can only break at certain
points, in my case between the data sets. There are a couple of cases
where one of the data sets takes more than a single page so that would
have to wrap normally, but the rest of the time it would be much
better to wrap it between the datasets.
Is this possible with iText?
Charlie M
------------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It is the best place to buy or sell services for
just about anything Open Source.
http://p.sf.net/sfu/Xq1LFB
_______________________________________________
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
____________________________________________________________________
Viessmann IT Service GmbH
Geschäftsführer: Dirk Klöckner, Dr. Harald Dörnbach
Sitz der Gesellschaft: Allendorf (Eder) - Registergericht:
AG Marburg (Lahn) - HRB 5324 - USt-IdNr.: DE258558424
____________________________________________________________________
------------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It is the best place to buy or sell services for
just about anything Open Source.
http://p.sf.net/sfu/Xq1LFB
_______________________________________________
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