I've managed to create a 2.4GB PDF using Spire and saved it to the file system.
I then try to run this code:
- Code: Select all
using (var loadedPdf = new PdfDocument(dest)
{
var formWidget = loadedPdf.Form as PdfFormWidget;
for (int i = 0; i < formWidget.FieldsWidget.List.Count; i++)
{
var pdfField = formWidget.FieldsWidget.List[i] as PdfField;
// If the two above conditions are met, create a bookmark.
CreateBookmark(loadedPdf, pdfField.Page, "test");
}
loadedPdf.SaveToFile(dest);
}
During testing, I've noticed that when loading the PDF into a PDF Document, it only seems to be able to load the first 2 pages of the original PDF (the full document is 81000 pages).
Then when trying to run the SaveToFile method, I receive a System.IO.Exception complaining that the file I'm trying to save is currently in use by another process.
I'd like to know why, in this instance, Spire is unable to load the full document into memory when loading the large PDF. I'm assuming that issue and the File Lock issue are probably related.
I can provide the 2.4GB PDF file to you for your internal testing so please let me know how best to pass that to you.
Thank you,
Zac