I tried doing the following:
using Stream stream = File.OpenRead(fileName); RadFixedDocument pdfDocument = new PdfFormatProvider().Import(stream); RadFixedDocument pdfNew = new(); pdfNew.Pages.Add(pdfDocument.Pages.First());
I get the following error:
System.ArgumentException: 'The document element is associated with another parent. (Parameter 'item')'
Is there a way to clone a page, so it can be added to another document?
Hello Henrik,
To achieve such a scenario you could use the PdfStreamWriter and its API to split the document into pages. We have SDK demo demonstrating this approach and also shows how to manipulate pages.
There is also a Knowledge Base (KB) article describing an approach for merging two document pages into a single page.
You could also merge documents with the Merge() method of RadFixedDocument. More about this can be found here.
Please give this approach a try and let us know if you encounter any obstacles.
Regards,
Peshito