You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to read a PDF file page by page using PdfReader and writer.GetImportPage() and output to another PDF file. It work perfectly when the file is small than 1G bytes in size.
But have error when reading a large file (say 2G byte with 200k pages)
var reader = new PdfReader(inputFilename);
var pageCount = reader.NumberOfPages;
for (var pageNo = 1; pageNo < pageCount; pageNo++)
{
var page = writer.GetImportedPage(reader, pageNo);
// write to another PDF file
}
When reading a large file, it keep showing the errors in below when instantiating PdfReaer
Output:
Exception message:
Full Stack trace:
Exception thrown: 'System.InvalidOperationException' in iTextSharp.LGPLv2.Core.dll
Exception thrown: 'System.IO.IOException' in iTextSharp.LGPLv2.Core.dll
Exception thrown: 'System.IO.IOException' in iTextSharp.LGPLv2.Core.dll
Exception thrown: 'System.FormatException' in System.Private.CoreLib.dll
Exception thrown: 'System.IO.IOException' in iTextSharp.LGPLv2.Core.dll
Exception thrown: 'System.IO.IOException' in iTextSharp.LGPLv2.Core.dll
Exception thrown: 'System.IO.IOException' in iTextSharp.LGPLv2.Core.dll
Exception thrown: 'System.IO.IOException' in iTextSharp.LGPLv2.Core.dll
Exception thrown: 'System.IO.IOException' in iTextSharp.LGPLv2.Core.dll
Exception thrown: 'System.IO.IOException' in iTextSharp.LGPLv2.Core.dll
Exception thrown: 'System.IO.IOException' in iTextSharp.LGPLv2.Core.dll
Exception thrown: 'System.IO.IOException' in iTextSharp.LGPLv2.Core.dll
Exception thrown: 'System.IO.IOException' in iTextSharp.LGPLv2.Core.dll
Exception thrown: 'System.IO.IOException' in iTextSharp.LGPLv2.Core.dll
Exception thrown: 'System.FormatException' in System.Private.CoreLib.dll
Exception thrown: 'System.IO.IOException' in iTextSharp.LGPLv2.Core.dll
Exception thrown: 'System.IO.IOException' in iTextSharp.LGPLv2.Core.dll
Exception thrown: 'System.IO.IOException' in iTextSharp.LGPLv2.Core.dll
Exception thrown: 'System.FormatException' in System.Private.CoreLib.dll
Exception thrown: 'System.FormatException' in System.Private.CoreLib.dll
Exception thrown: 'System.FormatException' in System.Private.CoreLib.dll
Exception thrown: 'System.FormatException' in System.Private.CoreLib.dll
Exception thrown: 'System.FormatException' in System.Private.CoreLib.dll
Exception thrown: 'System.FormatException' in System.Private.CoreLib.dll
Exception thrown: 'System.FormatException' in System.Private.CoreLib.dll
Exception thrown: 'System.FormatException' in System.Private.CoreLib.dll
Exception thrown: 'System.IO.IOException' in iTextSharp.LGPLv2.Core.dll
Exception thrown: 'System.FormatException' in System.Private.CoreLib.dll
Exception thrown: 'System.FormatException' in System.Private.CoreLib.dll
Exception thrown: 'System.FormatException' in System.Private.CoreLib.dll
Exception thrown: 'System.IO.IOException' in iTextSharp.LGPLv2.Core.dll
Exception thrown: 'System.FormatException' in System.Private.CoreLib.dll
Exception thrown: 'System.FormatException' in System.Private.CoreLib.dll
Exception thrown: 'System.FormatException' in System.Private.CoreLib.dll
Exception thrown: 'System.FormatException' in System.Private.CoreLib.dll
Exception thrown: 'System.FormatException' in System.Private.CoreLib.dll
Exception thrown: 'System.FormatException' in System.Private.CoreLib.dll
Exception thrown: 'System.FormatException' in System.Private.CoreLib.dll
Exception thrown: 'System.FormatException' in System.Private.CoreLib.dll
Exception thrown: 'System.FormatException' in System.Private.CoreLib.dll
Exception thrown: 'System.FormatException' in System.Private.CoreLib.dll
Exception thrown: 'System.FormatException' in System.Private.CoreLib.dll
Exception thrown: 'System.FormatException' in System.Private.CoreLib.dll
Exception thrown: 'System.FormatException' in System.Private.CoreLib.dll
Exception thrown: 'System.FormatException' in System.Private.CoreLib.dll
Exception thrown: 'System.FormatException' in System.Private.CoreLib.dll
Exception thrown: 'System.IO.IOException' in iTextSharp.LGPLv2.Core.dll
Exception thrown: 'System.FormatException' in System.Private.CoreLib.dll
Exception thrown: 'System.FormatException' in System.Private.CoreLib.dll
Exception thrown: 'System.FormatException' in System.Private.CoreLib.dll
Exception thrown: 'System.FormatException' in System.Private.CoreLib.dll
Exception thrown: 'System.IO.IOException' in iTextSharp.LGPLv2.Core.dll
Exception thrown: 'System.FormatException' in System.Private.CoreLib.dll
Exception thrown: 'System.FormatException' in System.Private.CoreLib.dll
Exception thrown: 'System.FormatException' in System.Private.CoreLib.dll
Exception thrown: 'System.FormatException' in System.Private.CoreLib.dll
Exception thrown: 'System.FormatException' in System.Private.CoreLib.dll
Exception thrown: 'System.FormatException' in System.Private.CoreLib.dll
Exception thrown: 'System.FormatException' in System.Private.CoreLib.dll
Exception thrown: 'System.FormatException' in System.Private.CoreLib.dll
Exception thrown: 'System.FormatException' in System.Private.CoreLib.dll
Exception thrown: 'System.FormatException' in System.Private.CoreLib.dll
:
The text was updated successfully, but these errors were encountered:
Summary of the issue
I want to read a PDF file page by page using PdfReader and writer.GetImportPage() and output to another PDF file. It work perfectly when the file is small than 1G bytes in size.
But have error when reading a large file (say 2G byte with 200k pages)
The large file for testing https://www.filemail.com/d/zooxpazvktiqxpx
Environment
Windows
Example code/Steps to reproduce:
When reading a large file, it keep showing the errors in below when instantiating
PdfReaer
Output:
The text was updated successfully, but these errors were encountered: