Concatenate method problem with PdfFileEditor

Greetings. I am unable to find any way to use the PdfFileEditor method Concatenate. The code completes, but when I go to open the generated pdf it says RunTime Error! (Visual C++ Runtime Library) The application has requested the Runtime to terminate it in an unusual way. I am using Aspose.pdf Runtime Version v4.0.30319 and version 7.3.0.0.

Here is the function. The lines I have commented out -- which are similar to what I saw on this forum -- did not work at all. It returns an empty memory stream. The current uncommented code does return a memory stream -- but only consists of memoryStream2 in most cases.

The code works on one pdf, but not all the rest. So I am wondering if it is possible that I need to add somehow a termination indicator to the end of each document.

Thank you!

Agraha


PS The Concatenate method is working with the attached NY IME-3 form, but not any others--including the attached NY IME-4 form.

private MemoryStream ConcatenateMemoryStreams(MemoryStream memoryStream1, MemoryStream memoryStream2)

{

PdfFileEditor pdfEditor = new PdfFileEditor();

//pdfEditor.AllowConcatenateExceptions = false;

MemoryStream concatenatedMemoryStream = new MemoryStream();

//not working as is from https://forum.aspose.com/t/101119

//using (memoryStream1)

//{

// using (memoryStream2)

// {

// pdfEditor.Concatenate(memoryStream1, memoryStream2, concatenatedMemoryStream);

// }

//}

pdfEditor.Concatenate(memoryStream1, memoryStream2, concatenatedMemoryStream);

return concatenatedMemoryStream;

}

Hi Agraha,


Thanks for your inquiry. I’m afraid while testing with latest Aspose.Pdf for .NET 8.0.0 API, I’m unable to notice the reported issue. Please download and try latest API, hopefully your issue will be resolved.

Please feel free to contact us for any further assistance.

Best Regards,

Thank you for your message. We will download the latest API. But as this just became available last Friday and we are well on our way in the testing cycle, is it possible for you to check if you see this as an issue with Aspose.Pdf for .NET 7.3.0.0? Thank you again.

Agraha

We downloaded Aspose.Pdf for .NET 8.0.0.0 and everything works perfectly. Thank you!

Hi Agraha,


I am glad to hear that your problem related to PdfFileEditor is resolved with latest release version. Please continue using our products and in the event of any further query, please feel free to contact.