Thomas Hoevel wrote:
pdfuser1 wrote:
Is there a way to copy/clone a page or a document object?
I don't know if "Clone()" works properly for pages.
With respect to file size of the big file, it is most likely better to create the big file first and split that into many single-page files later.
To minimize disk IO, save the file to a MemoryStream and read it from there.
Things that are somewhat inefficient can still be very fast on modern computers.
Yes, agree. Even with the current "inefficient" process, I can generate 5000 individual files, save them to individual networked folders and then generate a 5000-page 800MB batch file and save it to the network, all under 10 minutes. And that only happens once a year in my case. Most other times, it's a few dozens (or, at worst, a few hundred files).
So, all this is more of a learnign experience for me, in case if I ever need to worry about efficiency in another project. With that said, I have no experience with Streams or MemoryStreams, in general. I did try to go that route, but got nowhere. I probably wasn't closing the stream correctly because Adobe Acrobat was prompting me to save the file before closing. The file size on disk was indicative of a 3-page document, but I couldn't see anything beyond the first page. Is there a good example I can follow?
I truly appreciate your suggestions so far and am very thankful for the PDFsharp library. It's a great tool that we, developers, get to use for free.
