PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Mon Jul 15, 2024 6:14 pm

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: PdfPage Reference
PostPosted: Thu Apr 26, 2012 10:37 pm 
Offline

Joined: Wed Jun 11, 2008 3:20 pm
Posts: 6
I am adding a new PdfDictionary to Catalog, which has an element with direct value of a PdfArray. Each member of the PdfArray is a iref to a PdfPage. So, I'm adding a custom array of pointers to pages.

This works fine, and saves fine... but when I reload the document, my PdfArray is full of PdfDictionaries: which appear to be COPIES of the original PdfPages. PdfDictionarys with /Content, and the whole nine yards.

I'm not sure if this is a bug during load, or a bug during save, or my issue with no adding the indirect page references correctly somehow.


Top
 Profile  
Reply with quote  
 Post subject: Re: PdfPage Reference
PostPosted: Thu Apr 26, 2012 10:56 pm 
Offline

Joined: Wed Jun 11, 2008 3:20 pm
Posts: 6
Solved this. I do consider it a PdfSharp bug. If you access the iref for a page through something other than .Pages, it instantiates it as a PdfDictionary. I added the following code before my code to fix it:


// pre-load page instances to prevent instantiation as raw dictionaries
foreach (PdfSharp.Pdf.PdfPage page in pdf.Pages)
continue;


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

All times are UTC


Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 39 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