Large PDF not able to load/process

Hi there,

I have a PDF which is 40 MB in size. The C# program is stuck at absorber.Visit(document); line while loading/processing this file. Other files which are less than 30 MB are loading fine. Below is the code

Document document = new Document(file.FullName);
Aspose.Pdf.Facades.PdfBookmarkEditor editor = new Aspose.Pdf.Facades.PdfBookmarkEditor();
editor.BindPdf(document);
editor.DeleteBookmarks();
//Dictionary<int, string> sectionHeaders = new Dictionary<int, string>();
List<KeyValuePair<int, string>> sectionHeaders = new List<KeyValuePair<int, string>>();
// Create ParagraphAbsorber object
ParagraphAbsorber absorber = new ParagraphAbsorber();

                // Accept the absorber for first page
                absorber.Visit(document);

Can you let me know if there are any solutions to deal with PDF files which are larger in size?

I’m attaching the PDF zipped version.IHRT_ 184502BL5.zip (2.2 MB)

@sanjaybk

For larger size PDF files, you can use the ParagraphAbsorber or TextFragmentAbsorber like Classes at page level in order to prevent high memory consumption and CPU usage. For example,

foreach (var page in pdfDocument.Pages)
{
 // Instantiate ParagraphAbsorber
 ParagraphAbsorber absorber = new ParagraphAbsorber();
 absorber.Visit(page);
 // do other stuff
}

In case you still notice any issue, please feel free to let us know.