Free Support Forum - aspose.com

Encountering "Mehtod or Operation not implemented" when merging PDF

Hello,


I’m encountering this “Method or Operation not implemented” error while trying to add a PDF file to a new PDF file using the following code:

Document pdfDocument = new Document(pdf);

if (File.Exists(attachment.FilePath))
{
pdfDocument = pdfDocument.addPdf(attachment.FilePath);
}

Attached is the PDF that is causing the problem. And we are using Aspose.Pdf version 9.9.0.0 currently.

Appreciate for any suggestion.

Regards,
Yifan

Hi Yifan,


Thanks for contacting support.

I have tested the scenario and have observed that you are using some custom method pdfDocument.addPdf(…) to add pages collection from one file to other document. However my understanding is that you are trying to copy the pages from Newspaper+articles.pdf file and adding it to pages collection of another document. Therefore in order to test the scenario, I have used following code snippet and I am unable to notice any issue.

Please note that I have used latest release of Aspose.Pdf for .NET 10.6.0 and recommend you to please try migrating to latest release. In case the issue still persists, please share some sample project, so that we can again test the conversion in our environment. We are sorry for this inconvenience.

[C#]

//
load source file
<o:p></o:p>

Document pdfDocument = new Document("c:/pdftest/Newspaper+articles.pdf");

// create new Document instance

Document tempDoc = new Document();

//if (File.Exists(attachment.FilePath))

//{

// pdfDocument = pdfDocument.(attachment.FilePath);

//}

// add pages from main file to pages collection of Temp file

tempDoc.Pages.Add(pdfDocument.Pages);

// display the total page count of pages in temp file recently created

Console.WriteLine("Number of pages in Temp file = " + tempDoc.Pages.Count);