Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies. Get free and professional technical support for Spire.PDF for .NET, Java, Android, C++, Python.

Sun Feb 16, 2025 1:10 pm

Hello

Merging the following two PDFs fails with an Object reference error.

Link 1: https://www.daikin.eu/content/dam/docum ... 10A_LR.pdf

Link 2: https://assetsprod.microsoft.com/benefi ... nefits.pdf

Thanks,
R.

rararara
 
Posts: 7
Joined: Sat Oct 14, 2023 3:59 pm

Mon Feb 17, 2025 7:33 am

Hi,

Thanks for your inquiry.
I used the latest Spire.PDF (Version:11.2.4) to merge your PDF files, but didn't encounter the exception as yours. If you were not using the latest version, please give it a try. If the issue still occurs, please provide your test environment (e.g. Windows 10, 64bit) as well as your application type (e.g. Console App .NetFramework 4.7.2) to help us do further investigation.

Mt test code:
Code: Select all
//Get the paths of the documents to be merged
String[] files = new String[] {
    "C:\\Users\\Administrator\\Desktop\\ECPEN17-710A_LR (1).pdf",
    "C:\\Users\\Administrator\\Desktop\\Microsoft AI Cloud Partner Program benefits guide_Jan 2025.pdf"};

//Merge these documents and return an object of PdfDocumentBase
PdfDocumentBase doc = PdfDocument.MergeFiles(files);

//Save the result to a PDF file
doc.Save("Merged.pdf", Spire.Pdf.FileFormat.PDF);

Sincerely,
Nina
E-iceblue support team
User avatar

Nina.Tang
 
Posts: 1379
Joined: Tue Sep 27, 2016 1:06 am

Return to Spire.PDF