Joined: Fri Mar 05, 2010 8:04 pm Posts: 3 Location: Quakertown, PA
|
I am using the sample code to merge multiple PDFs into a single file. I have come across one file that produces an error in the code below.
' Iterate pages Dim PageCount As Integer = InputDocument.PageCount For PageIndex As Integer = 0 To PageCount - 1 ' Get the page from the external document... Dim page As PdfPage = InputDocument.Pages(PageIndex) <<===== Error ' ...and add it to the output document. OutputDocument.AddPage(page) Next
Here are the exception details:
System.NullReferenceException was unhandled Message="Object reference not set to an instance of an object." Source="PdfSharp" StackTrace: at PdfSharp.Pdf.PdfObject..ctor(PdfObject obj) at PdfSharp.Pdf.PdfDictionary..ctor(PdfDictionary dict) at PdfSharp.Pdf.PdfPage..ctor(PdfDictionary dict) at PdfSharp.Pdf.PdfPages.get_Item(Int32 index) at ConsoleApplication1.Module1.MergePDFs(List`1 SrcFilenames, String DestFilename, Boolean FullScreen) InnerException:
Any help in figuring out what is causing the error would be appreciated. I cannot provide the entire PDF file, because it is an internal document, but I may be able to provide part of it to help determine the error.
Thank you
|
|