PDFsharp & MigraDoc Foundation
https://forum.pdfsharp.net/

PdfSharp (1.32.2608) - Modify and Combine
https://forum.pdfsharp.net/viewtopic.php?f=2&t=2139
Page 1 of 1

Author:  ToniM [ Thu Sep 13, 2012 6:39 am ]
Post subject:  PdfSharp (1.32.2608) - Modify and Combine

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

Author:  Thomas Hoevel [ Thu Sep 13, 2012 8:23 am ]
Post subject:  Re: PdfSharp (1.32.2608) - Modify and Combine

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.

Author:  ToniM [ Thu Sep 13, 2012 8:54 am ]
Post subject:  Re: PdfSharp (1.32.2608) - Modify and Combine

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

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/