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