PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Sun Jun 30, 2024 4:29 pm

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Thu Sep 13, 2012 6:39 am 
Offline

Joined: Thu Aug 20, 2009 6:27 am
Posts: 14
Hi guys,


i got stuck while trying following procedure, maybe someone knows the solution (or maybe its a feature request for the next version):
- open PDF and modify it (or multiple PDFs; but dont save to a new file!)
- when ready modifing, concatenate all the modified pages to a new PDF document.


Modifing works good, but when i try to copy/clone the modified pages to the new document, i got an error in PdfPages.cs:ImportExternalPage.

Here my question:
Why isnt it allowed to make a clone of a modified page?
Is there a special reason i dont know?

Thanks in advance!

BR Toni


Top
 Profile  
Reply with quote  
PostPosted: Thu Sep 13, 2012 8:23 am 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3100
Location: Cologne, Germany
Hi!
ToniM wrote:
Why isnt it allowed to make a clone of a modified page?
I don't know. I presume it's more complicated because some work is done when the file is saved - these steps would have to be done before cloning.

You can save to a MemoryStream, load from the MemoryStream - and then you have your modified pages in a clean state and ready to be cloned.

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Thu Sep 13, 2012 8:54 am 
Offline

Joined: Thu Aug 20, 2009 6:27 am
Posts: 14
Thanks for your fast reply.

I tried just to comment those 2 lines and its working or lets say, i cant see a mistake on the output.

i had a rough look on the PdfDocument.cs:Save and here is what i found out:
- encryption will be skipped
- some document info fields (e.g. VersionInfo, Creator, Producer, ...)
- external fonts
- ...

Anyway, thanks for suggestion of the secure way.

BR Martin


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

All times are UTC


Who is online

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