Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » iText »

[iText-questions] concatenating documents

Rick Roen

2007-08-05

Replies:

 

I have an existing class that creates individual invoice documents. The Create method takes a stream object, which normally is a file stream.

 

Now I want to batch print invoices, so I want to call this Invoice class with a memory stream and then concatenate that stream into a “batch” document using pdfCopy and pdfReader.

 

I have the batch concatenation working when I create the individual invoices with a file stream which is then read by a pdfReader like on pg 64 of the book, but I cannot figure out how to do this with a MemoryStream.

 

The Invoice.Create method calls document.close and writer.close which closes the input MemoryStream which make the pdfReader(MemoryStream) fail because the stream is closed.

 

If call writer.flush so the MemoryStream is left open from the Invoice.Create method, the padReader(MemoryStream) fails with “Pdf header signature not found”.

 

How do I get a MemoryStream that I can use for the pdfReader?

 

Rick

-------------------------------------------------------------------------
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
iText-questions@(protected)
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/
©2008 junlu.com - Jax Systems, LLC, U.S.A.