Hiya, I upgraded to version itext-1.01.jar and recompiled all my codes. The problem remains. After some further testing, i notice when I set the custom width of the columns instead of using the default equal width distribution the out of memory error went away. Since 3 of the columns in my table contain very long strings of texts, i made the width of those columns much wider than others (which contains just an integer).  I really dont feel comfortable moving this into production from dev without knowing why it's doing this.
 
The fundamental problem is still why would a 20 page pdf generate out of memory errors, and why would everything work fine after removing a blank row or changing the column width. It just doesnt make sense, paulo or anyone can you shed some light on what would cause an out of memory exception other than a very large pdf? 
 
Also it seems my program satisfy peter's description - very big table cells(the 3 text columns) and cellsfitpage==true, could it be a bug then? if so, any work around?
 
thank you much,
 
gaga
 
 
-----------------------------
Hi Paulo,
in Version 1.01 / Paulo 126 of iText the bug with the infinite loop in very
big table cells and "cellsfitpage" set to "true" seems to be still there.

Do we have to pull a newer version from CVS?

Thanks,
Peter

 
In a message dated 11/20/2003 9:16:45 AM Eastern Standard Time, [EMAIL PROTECTED] writes:
Are you using the last iText version?
There was a problem with Table that caused an infinite loop.

Best Regards,
Paulo Soares

> -----Original Message-----
> From:    [EMAIL PROTECTED] [SMTP:[EMAIL PROTECTED]
> Sent:    Thursday, November 20, 2003 5:11
> To:    [EMAIL PROTECTED]
> Subject:    [iText-questions] very strange error with itext, please help
>
> Hello, I am generating pdf using itext from a db source through a servlet
> on weblogic6.1 and displays the pdf back in a webpage. The input for
> generating the pdf are just a bunch of user selected filters on a webpage.
>

>  I encountered a very strange bug:  java.lang.OutOfMemoryError <<no stack
> trace available>>. I know this error occurs when generating large pdfs but
> that is not the case.
> The servlet calls a bunch of stored procs in the db and add the resultsets
> from them to a itext Table.  Now for example, with input1 it generates a
> 150+ page of pdf perfectly, then I changed the filter to input2 and i get
> an out of memory error. However input two only suppose to generate like 20
> pages and I verified both the stored proc and java sql codes. The program
> runs until doc.add(datatable) then i get the out of memory error. My itext
> table contains 16 columns with 3 of them containing large amount of text
> (Text column datatype used in DB).

> After some testing I noticed:

> This is the header of my table:
> /***********  If I comment out the addCell(title) codes, everything
> works****
> ************  If I dont, i get out of memory error in certain inputs
> *******/
>                     datatable.addCell(new Phrase("title1",
> FontFactory.getFont(FontFactory.HELVETICA, 10, Font.BOLD)));
>                      datatable.addCell(new Phrase("title2",
> FontFactory.getFont(FontFactory.HELVETICA, 10, Font.BOLD)));
>                      datatable.addCell(new Phrase("title3",
> FontFactory.getFont(FontFactory.HELVETICA, 10, Font.BOLD)));
>                      datatable.addCell(new Phrase("title4"
> FontFactory.getFont(FontFactory.HELVETICA, 10, Font.BOLD)));

> ........etc
>                      datatable.addCell(new Phrase("title16",
> FontFactory.getFont(FontFactory.HELVETICA, 10, Font.BOLD)));
> /*************************************************************************
> *********/

>                    Cell spacer = new Cell(new Phrase(" ",
> FontFactory.getFont(FontFactory.HELVETICA_BOLD, 5, Font.BOLD)));
>                    spacer.setBorder(Rectangle.NO_BORDER);
>                    spacer.setColspan(NumCol);
>
> /***********  If I comment out the addCell(spacer) code, everything
> works****
> ************  If I dont, i get out of memory error in certain inputs
> *******/
>                    datatable.addCell(spacer);
>
>                    datatable.endHeaders();
>
> so basically if i comment out either the header name or the spacer,
> everything works fine. If i leave them both in, i get out of memory
> errors. Why is this happening? The total length of the pdf report is only
> 20ish pages how is an extra row of blank space causing it to go out of
> memory? especially since it can generate pdf with 150+ pages with no
> problem whatsoever. Please help, I cant seem to find any solution to this.

> Also in general what causes out of memory errors other than just a really
> large pdf.

> Thank you,

> [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
>

Reply via email to