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

PdfDocument Clone() doesn't return a new document.
https://forum.pdfsharp.net/viewtopic.php?f=2&t=4081
Page 1 of 1

Author:  IRlyDunno [ Fri Jan 10, 2020 12:50 pm ]
Post subject:  PdfDocument Clone() doesn't return a new document.

I have a template document that I need to copy the contents, so my first thought was the Clone method, but, unfortunatelly, I ended uo with a document that references the template. I noticed this because when I try to save the document it says: "Object does not belong to this document"

Whats the best way to create a deep copy of a document, I need everything even the AcroForm.

I'm using PdfSharp-gdi with the VersionBuild 5185

Author:  TH-Soft [ Sat Jan 11, 2020 2:01 pm ]
Post subject:  Re: PdfDocument Clone() doesn't return a new document.

IRlyDunno wrote:
Whats the best way to create a deep copy of a document, I need everything even the AcroForm.
You can open it several times with PdfReader to get completely independent copies. If you create the template dynamically in memory, then write it to a MemoryStream for use with PdfReader.

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