We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

ArgumentOutOfRangeException in InternalSubStringWithChecks for a specific document

Hi there,

When processing one of our documents we are getting the following exception:

System.ArgumentOutOfRangeException: Index and length must refer to a location within the string.
Parameter name: length
at System.String.InternalSubStringWithChecks(Int32 startIndex, Int32 length, Boolean fAlwaysCopy)
at System.String.Substring(Int32 startIndex, Int32 length)
at Aspose.Pdf.Text.TextSegment.( , Int32 , Int32 , TextEditOptions )
at Aspose.Pdf.Text.TextSegment..ctor( , Int32 , Int32 )
at Aspose.Pdf.Text.TextFragmentAbsorber.( , [] )
at Aspose.Pdf.Text.TextFragmentAbsorber.Visit(Page page)
at Aspose.Pdf.Page.Accept(TextFragmentAbsorber visitor)

For other documents everything is fine.

Looks like Aspose.Pdf has problems with some PDF files ?
Can you elaborate on that ? or fix this bug.

You can use the code below + attached PDF file in order to reproduce the problem:


public void SystemOutOfRangeErrorSample()


Document doc = new Document("Test.pdf");

int page = 0;

while (page < doc.Pages.Count)



TextFragmentAbsorber textFragmentAbsorber = new TextFragmentAbsorber();

Page processedPage = doc.Pages[page];




Thanks in advance for your effort,

Hi Wojciech,

Thank you for sharing the sample source code and template document.

I tested the scenario and noticed the same problem. For rectification, I logged this problem with ID “PDFNEWNET-33137” in our Issue Tracking System. We will further look into the issue and will keep you updated via this forum thread.

We apologize for your inconvenience.

Thanks & Regards,

Hi Wojciech,

Thanks for your patience.

I am very glad to inform you that our development team has been fixed the above mentioned issue and this will be a part of Aspose.Pdf for .NET v6.7 (to be released in February, 2012 as per our monthly release plan) after following the complete testing and release cycle. Please be patient and we will notify you once the version is available for download.

We apologize for your inconvenience.

Thanks & Regards,

The issues you have found earlier (filed as PDFNEWNET-33137) have been fixed in this update.

This message was posted using Notification2Forum from Downloads module by aspose.notifier.