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;
}