Duplicate and Cloneing pages from one document to another #299
Unanswered
demi-solemma
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
What is the best way to duplicate several copies of a page from a document to another document (new document contains two copies of the first page of the first document)?
I'm using v6.1.1
I'm trying with
Doc.AddPage((PdfPage)oldDoc.Pages[0].Clone());
but it throws an error: "An item with the same key has already been added"
Doc.AddPage(oldDoc.Pages[0]);
gives the same error (although from the documentation page it sounds like
AddPage(page)
should create a copy of the page andClone()
shouldn't be necessary. )perhaps when Doc.AddPage(page) is called the page id or something wasn't updated? how can I update the key?
or maybe I am approaching is completely wrong?
Also would like to ask if it is possible to draw something under the duplicated pages, these will be different on each copies of the page.
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions