Rune Hellem wrote:
> I am creating a PDF-document of my blog, writing each post one by one. 
> The problem is when one of the posts have so much content that it 
> exceeds the current column. The text will just disappear.

The remaining text is still in the ColumnText object,
but you don't render it.

> I am not aware 
> of any methods in class ColumnText that tells me that I now have to much 
> text.

Yes, you are aware of such a method.
You are already using it in your code:

>                 status = ct.go(true);
>                
>                 // Need a new column?
>                 if (ColumnText.hasMoreText(status)) {

If (ColumnText.hasMoreText(status)) is true, you still have content
in your ColumnText object. That content needs to be rendered, or it
will disappear. In the code that follows, you are missing a go() method.

>                     column = (column + 1) % 2;
>                     // Need a new page?
>                     if (column == 0) {
>                         document.newPage();
>                         // Draw a line between the columns
>                         drawColumnlines(writer);
>                     }
>                     // Create the colum
>                     ct.setSimpleColumn(COLUMNS[column][0], 
> COLUMNS[column][1],
>                             COLUMNS[column][2], COLUMNS[column][3]);
>                     y = COLUMNS[column][3];

HERE YOU NEED ANOTHER ct.go();
but you'll need to rearrange the code in your loop,
otherwise you'll overwrite that content with the next blog entry.

>                 }
>                 // Reset and write the content to the PDF
>                 ct.setYLine(y);
>                 ct.setText(null);
>                 addContent(ct, blogpost);
>                 status = ct.go();
> 
> (...looking forward to the release of the new book later this year :-) )
> 
> In advance
> 
> Rune
> 
> -- 
> ****************************************************
> Bored? Check out http://hellem.org/blog
> ****************************************************
> 
> 
> ------------------------------------------------------------------------
> 
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by 
> 
> Make an app they can't live without
> Enter the BlackBerry Developer Challenge
> http://p.sf.net/sfu/RIM-dev2dev 
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> iText-questions mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/itext-questions
> 
> Buy the iText book: http://www.itextpdf.com/book/
> 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/


------------------------------------------------------------------------------
This SF.net email is sponsored by 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.itextpdf.com/book/
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