Our client is using Aspose PDF, the file Aspose.Pdf.dll, version 2015.01.12 (10.0.0.0). During processing certain currupted PDF files the multiple functions just hang. Normal files and some other corrupted files are processed in reasonable time.
He asked me to check if the newest version is Ok for processing this file. Unfortunately it hangs similarly.
Example of the file can be taken from here: Dropbox - File Deleted - Simplify your life
Example of code we used in particular like this:
private static int PDFToPDF(string fileName, Aspose.Pdf.Document pdfDocument)
{
try
{
Console.WriteLine($@“Read source document from {Path.GetFileName(fileName)}”);
var sourcePdf = new Document(fileName);
var device = new TextDevice(new TextExtractionOptions(TextExtractionOptions.TextFormattingMode.Raw));
foreach (Page page in sourcePdf.Pages)
{
pdfDocument.Pages.Add(page);
device.Process(page, Stream.Null);
}
Console.WriteLine(@"The source document has been processed");
return 0;
}
catch (Exception exception)
{
Console.WriteLine(exception.Message);
return exception.Message.Contains("password") ? 1 : 2;
}
}