Free Support Forum - aspose.com

'System.StackOverflowException' occurred in Aspose.Pdf.dll

I continue to get the 'System.StackOverflowException' occurred in Aspose.Pdf.dll anytime I use the pdf file editor concatenate method with a specific .pdf. We have never come across this issue with any of our past .pdfs. I do not see a difference in this .pdf as compared to others. I tested this out in Aspose.Pdf 7.4.0 and again with the latest version 7.7.0. Both give me the same error. I am confused on what it could be - like I said, it works with any other .pdf document. Any ideas?

This is what my code looks like (and has been working fine for years):

Dim TheInStrings(arraySize) as String

'TheInStrings gets populated with strings (the file path and file name of the .pdfs we would like to concatenate)

Dim DocumentsLocation As String = ""

'DocumentsLocation is populated with the file path and file name of where we would like to save the concatenated .pdf

Dim pdfEditor as PdfFileEditor = New PdfFileEditor

pdfEditor.Concatenate(TheInStrings, DocumentsLocation)

Hi Melanie,


Thanks for using our products.

Can you please share the PDF file causing this issue so that we can test the scenario at our end. We are sorry for this inconvenience.

Please note that documents vary from each in terms of their structure and complexity and there might be some issue with the structure of file causing this exception. But before I comment further, we need to test and investigate this issue details.

Thank you for the quick response! Attached is the .pdf document we are having the issue with. Please note that I even tested removing all but a single page and it still failed.

Hi Melanie,


Thanks for sharing the resource file.

In order to test the scenario, I have first create the copy of NM++Audit+Handbook++12+Jun+2012.pdf file which you have shared and have tried concatenating the two document using following code snippet with Aspose.Pdf for .NET 7.7.0 and I have used Visual Studio 2010 project (with .NET 4.0 as target platform of application) running over Windows 7 (X64) and I am unable to notice any issue. Can you please share some further details regarding your working environment.

We are really sorry for this inconvenience.


PS, For your reference, I have also attached the resultant PDF file which is generated over my end.

Of course! I am using Aspose 7.4.0, Visual Studio 2008 Professional Edition, .NET 3.5 on a Windows 7 (x64) machine. As stated in my original post, I also tested it using Aspose 7.7.0 and it still failed.

Look forward to hearing from you.

Hi Melanie,


Thanks for sharing the details. I have again tested the scenario using Aspose.Pdf for .NET 7.7.0 over Windows 7 (X64) in Visual Studio 2010 project where I have set the target platform of application as .NET Framework 3.5 and I am still unable to notice the issue when concatenating the PDF files. Can you please share some sample project which can help us in replicating this issue.

We are really sorry for this inconvenience.

We modified the .pdf in many ways this morning to continue my testing. We noticed one of the pictures on the .pdf had a link to an external site. So, we “printed to a pdf” which created a new .pdf and stripped all of the items in the background (such as the links). It works like a charm now. I’m guessing our system didn’t trust the link or something??? Is this something that can be handled within Aspose?

acemel23:
We modified the .pdf in many ways this morning to continue my testing. We noticed one of the pictures on the .pdf had a link to an external site. So, we “printed to a pdf” which created a new .pdf and stripped all of the items in the background (such as the links). It works like a charm now. I’m guessing our system didn’t trust the link or something??? Is this something that can be handled within Aspose?

Hi Melanie,

Thanks for sharing the details.

I am glad to hear that your problem is resolved. However I still wonder why I could not replicate the issue over my end. May be you have some specific configurations on your system which are preventing access to external links etc and that’s why the problem was occurring. Anyways, please note that you can also use Aspose.Pdf for .NET to Add/Remove/Update links in PDF file. Links are treated as Annotation in Aspose.Pdf for .NET. Please visit the following link for further information on Delete a Particular Annotation from the PDF File

In the event of any further query, please feel free to contact.