string[] files = Directory.GetFiles(folder);
PdfLoadedDocument document = new PdfLoadedDocument(files[0]);
for (int i = 1; i < 5; i++)
{
PdfLoadedDocument loadedDocument = new PdfLoadedDocument(files[i]);
document.Append(loadedDocument);
document.Save("Sample.pdf");
document.Close(true);
loadedDocument.Close(true);
if (i < 4)
document = new PdfLoadedDocument(@"Sample.pdf");
}
Process.Start("Sample.pdf");
Come on Syncfusion. Fix your code please. I'm already searching for a new Software provider because of this.
I'm encountering similar issues. From what i can see there does in fact appear to be some kind of issue with the Syncfusion code. A memory leak or something. Has Syncfusion dug into their code to see if find out what the underlying issue is?
I'm trying to merge the same 50KB document into a single document 1000 pages long while keeping the main document open. This will consume over 1 GB of memory on my development machine, but complete in 90 seconds.
This amount of memory consumption does not make sense to me. Even if 1000 50 KB documents are read into memory that only accounts for a fraction of 1 GB memory consumption.
Also, I've tried Gesha's code smippet AND PERFORMANCE IS HORRIBLE even though the Memory issue has disappeared.
To merge 50 1 page 60 KB documents together into 1 50 page document it took a blistering 15 minutes. That is quite possibly the worst performing code i've seen on any level on any platform to do such a seemingly simple operation. you cannot tell me that there is not an issue with Syncfusion because from my perspective there is.
If I'm wrong, then please post a code snippet that allows me to merge MANY single page documents in a single PDF without crashing our code on a workstation or server OR taking absolutely forever.