We recently moved from Pdf.Kit to Pdf. However, there are some files that cause hangs in the new Pdf, that did not with regard to Pdf.Kit. I have attached a sample PDF file.There seems to be two different functions that cause the hang, both used for text extraction. Only #2 was available for Pdf.Kit, but it worked, and extracted the text. When opened with Abobe Reader, there is an alert prompt, but it otherwise loads. Regardless, I am not expecting a hang! We have multiple files that cause this problem.
Aspose.Pdf.Document pdfDoc = new Aspose.Pdf.Document(file, "");
foreach (Aspose.Pdf.Page pdfPage in pdfDoc.Pages)
using (MemoryStream textStream = new MemoryStream())
Aspose.Pdf.Devices.TextDevice textDevice = new Aspose.Pdf.Devices.TextDevice();
Aspose.Pdf.Text.TextOptions.TextExtractionOptions textExtOptions = new Aspose.Pdf.Text.TextOptions.TextExtractionOptions(Aspose.Pdf.Text.TextOptions.TextExtractionOptions.TextFormattingMode.Raw);
textDevice.ExtractionOptions = textExtOptions;
Aspose.Pdf.Facades.PdfExtractor pdfEx = new Aspose.Pdf.Facades.PdfExtractor();