Free Support Forum - aspose.com

Extract text from PDF document in C# using Aspose.PDF - ArithmeticException occurs

Hi, I’m trying to check if a pdf page contains any text. When calling Aspose.Pdf.Text.TextAbsorber.Visit(Page page) I get the following exception:

ArithmeticException
Overflow or underflow in the arithmetic operation.
System.ArithmeticException: Overflow or underflow in the arithmetic operation.
at . ()
at . (BaseOperatorCollection , Resources )
at . ()
at …ctor(Page , TextSearchOptions , Boolean )
at Aspose.Pdf.Text.TextAbsorber.Visit(Page page)
at DDiAsposeHelper.AsposeHelper.ContainsText(Page page) in D:\Workspaces\Development\3.x\iProducts\Source\Extensions\AsposeHelper\DDiAsposeHelper\AsposeHelper.cs:line 368’

I have a c# COM server that is used from Delphi. The exception dos not occur on the first use but it looks like on the third use and any subsequent use of the function.

The function in the dll loads de pdf document and checks if the pages contain text.

@andreas4e47b,

Kindly send us the complete code, source PDF, and let us know which Aspose.PDF for .NET API version you are using. We will investigate your scenario in our environment, and share our findings with you. Your response is awaited.