I am running into a memory issue with the PDF.Kit's PDFExtractor with very large (500mb+) Portfolio PDFs.
Please advise- here is my code usage and comments.
PdfExtractor extractor = new Aspose.Pdf.Kit.PdfExtractor();
extractor.ExtractAttachment(); // This is where it fails.
ArrayList attachNames = extractor.GetAttachNames();
int counter = 0;
foreach (var name in attachNames)
ArrayList attachInfo = extractor.GetAttachmentInfo();
foreach (AsposePDFKit.AttachmentInfo info in attachInfo)
..... //extract the individual attachments
The OutOfMemory exception occurs on line 3, "extractor.ExtractAttachment();".
The reason I call ExtractAttachment() without specifying a specific attachment filename is because I haven't found a way to get the attachment names without first calling ExtractAttachment(). Using extractor.GetAttachNames() before ExtractAttachment() yields an Object not Referenced exception, but I think it would solve the memory problem if I could just get the list of names so that I could then extract them individually, or ideally if there was a way to enumerate through attachments one at a time regardless of their filename so that so much memory wouldn't be spent preparing streams for all of the attachments at once.
I believe the problem is that I must call ExtractAttachment() before GetAttachNames() to get the list of attachment names, and ExtractAttachment() is potentially very memory intensive because it prepares streams for all of the attachments. Please let me know if there is a memory-safe way to use the PdfExtractor.
Thank you for any help