There's no solution to it other than keeping the connection alive by other means, by javascript, for example. You can send the document as it's generated but it won't work in IE because of the lack of content size.
Best Regards, Paulo Soares > -----Original Message----- > From: [EMAIL PROTECTED] [SMTP:[EMAIL PROTECTED]] > Sent: Wednesday, February 05, 2003 19:46 > To: [EMAIL PROTECTED] > Subject: RE: [iText-questions] PDF overlapping text in IE > > Hi Paulo, > > Thanks for all the help in debugging PDF problems that we had a while > ago. > We are now generating a new PDF report using iText. This report can be > upto > 5000 pages long. > We are able to generate 2000 page reports without any problem, but we have > problems generating a PDF more than 2000 pages. what happens is either > browser times out and displays page cannot be displayed or we running out > of > memory on the server. > > We are generating a PDF dynamically using servlet output stream, after > getting the result set back from stored procedure we put them in an object > and put the object in a vector. we loop through the vector retrieve the > bean > from the vector and generate the PDF using iText elements. > > And also I want to know if there is anyway we can stream the blocks of > data > back to the browser instead of writing all at once. What I mean is like > get > the data for 2 pages display it and keep the reponse alive to the browser > and keep streaming till the end of the report. > > I am also attaching a code snippet for your reference. > > Can you please try to suggest me some soultion for this problem? > > Thanks & regards, > Madhu Vempati. > WellsFargo services co. > Commercial Electronic Office. > 612-466-5652 > > > > > > -----Original Message----- > From: Paulo Soares [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, December 18, 2002 5:51 PM > To: [EMAIL PROTECTED] > Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED] > Subject: Re: [iText-questions] PDF overlapping text in IE > > > When the leading is not set the value that is stored is NAN (not-a-number) > that can be tested and provided with a default value or a value derived > from > the first Phrase in the Cell. I may speculate that the Websphere JVM at > some > time messes up the floating point state processor and causes erraneous > values to be returned for the NAN. This would explain the behavior for all > the other users of the JVM after the first problem. I suppose that if you > set explicitly the cell leading the problem goes away. A leading of 3 is > too > small for the font you use. The leading should be at least the size of the > font otherwise it will overlapp (the leading in PDF is the space between > text baselines, it's different from the awt definition). > > Best Regards, > Paulo Soares > ----- Original Message ----- > From: <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Cc: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> > Sent: Wednesday, December 18, 2002 21:26 > Subject: RE: [iText-questions] PDF overlapping text in IE > > > > Hi Paulo, > > > > Thanks for all your help on this. > > We have done some testing with the leading value. > > We have found that the Cell leading is 0, even when we get the > overlapping > > lines. > > During our testing we set the leading to 3. > > Using this value we eliminated the overlapping data, but we were left > with > > some triple spaced data. > > > > In any case, the behavior of our code when ran on our Application Server > is > > this: > > 1. All PDF documents generated under 10 pages in length (for default > > leading) or 16 pages (for leading of 3) look styled as designed. > > > > 2. When the first document over 10 pages is generated, all pages > starting > > with page 10 look styled with overlapping lines. (it appears to take > the > > leading and subtract 3 from it) > > > > 3. Every PDF document of all lengths generated by all users after > #2(above) > > looks styled with overlapping lines. (when we set the leading of all > Cells > > to 3 all PDF documents at this point look styled like the original 0 > that > we > > use when running in our NT test environment) > > > > 4. Each time we restart WebSphere we start at back at #1(above). This > means > > our work-around requires that we set our leading to 3 and generate 1 PDF > > document 16 pages or larger before we can expect properly spaced > documents. > > > > > > > > Any ideas on what leading "state" is being set, or why we are getting > this > > type of response would be welcome. Also if you would like to recommend > a > > better work-around for our situation that would be great. > > Again, thanks for looking at this code for us, using this technique at > least > > allows us to continue using itext in our Unix environment. > > > > Chad > > > > -----Original Message----- > > From: Paulo Soares [mailto:[EMAIL PROTECTED]] > > Sent: Wednesday, December 04, 2002 5:14 AM > > To: '[EMAIL PROTECTED]' > > Subject: RE: [iText-questions] PDF overlapping text in IE > > > > > > The leading is the line spacing between baselines (it's different from > the > > awt definition). If you don't set the leading, as in your case with only > > adding chunks, the leading is set at 16. I had a look at the code and > all > is > > ok. I would advise you to print the leading as I said in the last > message, > > it will narrow the search for the problem. > > > > Best Regards, > > Paulo soares > > > > > -----Original Message----- > > > From: [EMAIL PROTECTED] [SMTP:[EMAIL PROTECTED]] > > > Sent: Tuesday, December 03, 2002 22:40 > > > To: [EMAIL PROTECTED] > > > Subject: RE: [iText-questions] PDF overlapping text in IE > > > > > > Paulo, > > > > > > Thanks for looking at this code. Here are the Constants files you > asked > > > about. > > > You're right about the logo.gif, I never thought of that, thanks. > > > What is the leading(), I know nothing about this. > > > Is there somewhere on the lowagie.com that I can read about this? > > > I feel like I missed something important here. > > > > > > Chad > > > > > > -----Original Message----- > > > From: Paulo Soares [mailto:[EMAIL PROTECTED]] > > > Sent: Tuesday, December 03, 2002 3:32 PM > > > To: [EMAIL PROTECTED] > > > Subject: Re: [iText-questions] PDF overlapping text in IE > > > > > > > > > I need to have a look at StyleConstantsPDF.java and PDFConstants.java. > > > This > > > is the default cell factory and if anything goes wrong here it will > > > propagate for all the subsequent documents. It would be interesting to > > > print > > > the leading() returned for each call to PDFConstants.getDefaultCell() > just > > > before being added to the table. > > > Another thing not related to this, you only need to create the logo > image > > > once and use it in all the application, if you don't change the > parameters > > > it's thread safe. > > > > > > Best Regards, > > > Paulo Soares > > > > > > ----- Original Message ----- > > > From: <[EMAIL PROTECTED]> > > > To: <[EMAIL PROTECTED]> > > > Sent: Tuesday, December 03, 2002 20:52 > > > Subject: RE: [iText-questions] PDF overlapping text in IE > > > > > > > > > > > > > > Here are 3 of the files that we use to create a Document and add > > > Elements > > > to > > > > it. > > > > We are using the Formatter to create the Document, the DocumentPDF > to > > > add > > > > Elements, > > > > and of course the AccountElement is one of many class files we use > to > > > create > > > > elements. > > > > > > > > Let me know if you have any questions about our code. > > > > > > > > thanks much, > > > > Chad > > > > > > > > -----Original Message----- > > > > From: Paulo Soares [mailto:[EMAIL PROTECTED]] > > > > Sent: Tuesday, December 03, 2002 11:53 AM > > > > To: '[EMAIL PROTECTED]' > > > > Subject: RE: [iText-questions] PDF overlapping text in IE > > > > > > > > > > > > How do you set the text leading? It must be a change in the text > leading > > > > information that causes the overlapped lines. The default leading is > > > reset > > > > each time a new Document instance is created so, something happens > from > > > your > > > > side that keeps feeding the wrong leading. > > > > Can you send me your servlet class? > > > > > > > > Best Regards, > > > > Paulo Soares > > > > > > > > > -----Original Message----- > > > > > From: [EMAIL PROTECTED] > [SMTP:[EMAIL PROTECTED]] > > > > > Sent: Tuesday, December 03, 2002 17:22 > > > > > To: [EMAIL PROTECTED] > > > > > Subject: RE: [iText-questions] PDF overlapping text in IE > > > > > > > > > > Hi Paulo, > > > > > thanks for the information. > > > > > this problem does not occur when we test our code using Web Sphere > IDE > > > on > > > > > Windows NT. > > > > > this leads us to believe that we are using the API correctly. > > > > > > > > > > somehow when we run this code on our Unix Application Server we se > > > this > > > > > behavior. > > > > > the interesting thing is that when we only return small (8 or 9 > page) > > > PDF > > > > > reports the problem does not exist. this problem starts after > around > > > page > > > > > 8 > > > > > or 9 on larger reports. > > > > > > > > > > another interesting thing we noticed is that once we see the > > > overlapping > > > > > occur on a large report, we try to go back to requesting a small > > > report > > > > > and > > > > > the overlapping occurs from the first page and continues for each > and > > > > > every > > > > > subsequent report created until the server is restarted. > > > > > > > > > > hopefully these additional details will stir up some helpful > ideas. > > > > > let me know if you have seen anything like this before. > > > > > > > > > > thanks in advance, > > > > > Chad > > > > > > > > > > > > > > > > > > > > -----Original Message----- > > > > > From: Paulo Soares [mailto:[EMAIL PROTECTED]] > > > > > Sent: Friday, November 29, 2002 11:37 AM > > > > > To: '[EMAIL PROTECTED]'; > > > [EMAIL PROTECTED] > > > > > Subject: RE: [iText-questions] PDF overlapping text in IE > > > > > > > > > > > > > > > I didn't understand the problem when you posted it as a bug. It's > > > still > > > > > not > > > > > a bug, at least not an iText one. I examined the file problem.pdf > and > > > it > > > > > was > > > > > generated correctly, all the offsets are in place so the problem > is > > > with > > > > > what you asked iText to do. In other words, the file is correct > but > > > you > > > > > didn't give the right API commands and the result was overlapped > > > lines. > > > > > Somewhere in your code you changed the paragraph or table leading > to > > > such > > > > > a > > > > > small value that the lines overlap. It has nothing to do with > caching > > > > > unless > > > > > there are some threading issues with your code that are triggered > by > > > the > > > > > no-cache, mainly the repeated generation of the same report by > > > different > > > > > threads or a static document that shouldn't be. > > > > > > > > > > Best Regards, > > > > > Paulo Soares > > > > > > > > > > > -----Original Message----- > > > > > > From: [EMAIL PROTECTED] > > > > > [SMTP:[EMAIL PROTECTED]] > > > > > > Sent: Friday, November 29, 2002 17:08 > > > > > > To: [EMAIL PROTECTED] > > > > > > Subject: [iText-questions] PDF overlapping text in IE > > > > > > > > > > > > Hi, > > > > > > > > > > > > i looked through the archives and found others having trouble > > > > > dynamically > > > > > > generating PDF files and delivering them to IE browser, > > > > > > but none quiet like mine. i am using the work-around technique > > > below > > > > > > (from > > > > > > http://www.lowagie.com/iText/faq.html#msie) > > > > > > yet for some reason IE wants to download the file. the save > file > > > > > dialogue > > > > > > box appears when the report is generated. > > > > > > the file is not available when i choose download, but that's not > how > > > i > > > > > had > > > > > > hoped it would work. > > > > > > i am using Solaris and websphere(4.0). When i set the cache (as > > > > > follows) > > > > > > i > > > > > > get the report back but the reports start to overlap text after > > > about > > > > > > 9 or 10 pages. Once the overlapping has occurred even the > smaller > > > files > > > > > > will overlap from the beginning. If i stick to the around 8 > page > > > > > > documents > > > > > > the overlapping never occurs. Thanks in advance, chad > > > > > > res.setHeader( "CacheControl", "no-cache"); > > > > > > res.addHeader("Pragma", "no-cache"); > > > > > > res.setContentType("application/pdf"); > > > > > > ByteArrayOutputStream ba = new ByteArrayOutputStream(); > > > > > > generate_pdf(ba); > > > > > > res.setContentLength(ba.size()); > > > > > > ServletOutputStream out = res.getOutputStream(); > > > > > > ba.writeTo(out); > > > > > > out.flush(); > > > > > > > > > > > > > > > > > > > Chad E. Iverson > > > > > > > Wells Fargo Services Company > > > > > > > Commercial Electronic Office > > > > > > * 612-316-2375 > > > > > > * 612-518-9597 > > > > > > > > > > > > > > > > > > > > > > > > ------------------------------------------------------- > > > > > > This SF.net email is sponsored by: Get the new Palm Tungsten T > > > > > > handheld. Power & Color in a compact size! > > > > > > http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0002en > > > > > > _______________________________________________ > > > > > > iText-questions mailing list > > > > > > [EMAIL PROTECTED] > > > > > > https://lists.sourceforge.net/lists/listinfo/itext-questions > > > > > > > > > > > > > > > > > > > > > << File: StyleConstantsPDF.java >> << File: PDFConstants.java >> > << File: code.doc >> ------------------------------------------------------- This SF.NET email is sponsored by: SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! http://www.vasoftware.com _______________________________________________ iText-questions mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/itext-questions
