Simplified example from my application:
var text = “1”;
var pdfDoc = new Document(“cs_10.pdf”);
var textAbsorber = new TextFragmentAbsorber($"(?i){text}", new TextSearchOptions(true));
pdfDoc.Pages.Accept(textAbsorber);Console.WriteLine(textAbsorber.TextFragments.Count);
Error:
Unhandled exception: System.ArgumentOutOfRangeException: Index is out of range. The index must be a positive number, and its size should not exceed the size of the collection.
Parameter name: startIndex
в System.Globalization.CompareInfo.IndexOf(String source, String value, Int32 startIndex, Int32 count, CompareOptions options)
в System.Globalization.CompareInfo.IndexOf(String source, String value, Int32 startIndex, CompareOptions options)
в Aspose.Pdf.Text.TextFragmentAbsorber.(♫??? , [] )
в Aspose.Pdf.Text.TextFragmentAbsorber.Visit(Page page)
в Aspose.Pdf.PageCollection.Accept(TextFragmentAbsorber visitor)
в TextLayerExtractor.Tests.Program.GetTextPosition() в D:\Projects\SmartInstruments\src\TextExtractorService\TextLayerExtractor.Tests\Program.cs:строка 161
в TextLayerExtractor.Tests.Program.Main() в D:\Projects\SmartInstruments\src\TextExtractorService\TextLayerExtractor.Tests\Program.cs:строка 84
Error is reproduced if I try to search any text with length = 1
Document was created before with Aspose PDF too:
cs_10.pdf (2.5 MB)
Aspose.PDF version 18.5.0.0, licensed