PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Sat Apr 27, 2024 11:35 pm

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: Fri Mar 05, 2010 8:19 pm 
Offline

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


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 399 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Privacy Policy, Data Protection Declaration, Impressum
Powered by phpBB® Forum Software © phpBB Group