PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Sat Oct 24, 2020 7:49 pm

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Tue Jul 07, 2020 3:31 pm 
Offline

Joined: Tue Jul 07, 2020 3:01 pm
Posts: 2
I have an application that requires merging hundreds of PDF letters together. PDFSharp, when working with up to around 1200 or so letters works quite nicely for this. The problem is when going somewhere above that number the program crashes, presumably with an out of memory or other similar error.

My question is whether there's a way to stop the process at a certain number of letters, close the existing output file, open a different one, and continue? I've tried doing this but so far, no joy. I can open a new output file but the second file always contains all of the letters as if from the beginning.

I suppose I could keep track of the files processed, delete them from the working folder and restart the entire process but that's a lot of extra work and risk I'd rather not get into if possible.

Has anyone done this before?

TIA...


Top
 Profile  
Reply with quote  
PostPosted: Wed Jul 08, 2020 11:47 am 
Offline
PDFsharp Expert
User avatar

Joined: Sat Mar 14, 2015 10:15 am
Posts: 580
Location: CCAA
BobInCT wrote:
My question is whether there's a way to stop the process at a certain number of letters, close the existing output file, open a different one, and continue?
Yes, that's the way to go.
It is known to work when implemented correctly. Make sure to dispose the PDF document objects you no longer need.

Compile a list of files to process and make sure you add every file on the list just once.

_________________
Best regards
Thomas
(Freelance Software Developer with several years of MigraDoc/PDFsharp experience)


Top
 Profile  
Reply with quote  
PostPosted: Thu Jul 09, 2020 7:30 pm 
Offline

Joined: Tue Jul 07, 2020 3:01 pm
Posts: 2
I was able to get this working but only by moving a specific quantity of files to a temp directory, merge them into a single PDF, clean up the temp directory, and then repeat the process with another set. In the end I had multiple merged PDF files which was my goal.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: Bing [Bot] and 10 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Privacy Policy, Data Protection Declaration, Impressum
Powered by phpBB® Forum Software © phpBB Group