Hi,
Thanks for you providing.
I saved your sample as a new pdf document with same pages and tried to merge the new document and your sample two times using two merging method as below, but all worked ok. Would you please tell us your system environments?
On my end Merging1 took 4 minutes and Merging2 took 6 minutes. What is your code? How many pdf files you merge to take 5 minutes? If you also used another pdf document except programming.pdf, please also send it to us for investigation. Thank you.
- Code: Select all
string[] files = { "..\\..\\Input\\programming_new.pdf", "..\\..\\Input\\programming.pdf" };
public void Merging1(string[] files,string result)
{
PdfDocument doc1=new PdfDocument();
doc1.LoadFromFile(files[0]);
PdfDocument doc2 = new PdfDocument();
doc2.LoadFromFile(files[1]);
doc1.AppendPage(doc2);
doc1.SaveToFile(result);
}
public void Merging2(string[] files, string result)
{
PdfDocumentBase doc1 = PdfDocument.MergeFiles(files);
doc1.Save(result, FileFormat.PDF);
}
Best Regards,
Amy
E-iceblue support team