Bruno Lowagie (iText) wrote: > > ssinai wrote: >> Hi, is it possible to open a pdf file that has been closed, and append >> data >> to the end of it? > > This is an ambiguous question. > Do you want to create a PDF in 2 passes (see chapter 2 of the book)? > Do you want to change an existing PDF? > Do you want to create an update PDF (with more than one XRef table)? > You'll have to elaborate. > Maybe you should start reading the tutorial about PdfCopy > and PdfStamper. > br, > Bruno > > Why read the tutorials when I have your book? > > Anyway, I'm working on an application where we're trying to convert lots > of Swing tables to pdf. Each table takes up one full page of a pdf > document. For each table, I'm creating a PdfGraphics2D object, and > drawing into it along the lines of ...mySwingTable.print(PdfGraphics2D > g2). This seems to be working pretty well as long as we don't have too > many tables. But in one of our use cases, we have over 900 Swing tables > that we need to place into a pdf document. > > I try to loop through the list of 900 tables and convert each one to a new > pdf page in a document. After about 300 pages, the free memory is > exhausted, the pdf processing stops, and the document closes itself. So > we get a document of about 300 pages, which at this point is about 90 Mb. > It's readable, but I need all 900 pages. > > I've tried a few things to free up memory during this process, like > getting rid of the Swing tables after they've been converted to pdf, and > while I've been able to get an extra 10 or so pages generated from doing > this, it's not solving the problem. I was thinking about doing something > like opening a document, generating 100 pages of pdf from Swing tables, > closing the document in the hope that it would flush everything to disk > and free up memory, and then reopening the document to repeat the process > until all 900 tables were converted to pdf. I don't know what's going on > with memory as pdf documents are generated, so don't know whether this > will work, but I thought it would be worth a try. > > Any suggestions would be appreciated. I guess this is basically the same > thing as putting 900 large images into a pdf document. In fact, we're > supposed to be able to produce documents consisting of thousands of pages, > but if I can do the 900 pages, I'd be happy. Thanks. > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > iText-questions mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/itext-questions > Buy the iText book: http://itext.ugent.be/itext-in-action/ > >
-- View this message in context: http://www.nabble.com/Appending-to-end-of-pdf-file-tf4694435.html#a13442806 Sent from the iText - General mailing list archive at Nabble.com. ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ iText-questions mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://itext.ugent.be/itext-in-action/
