On Mon, 2019-02-18 at 13:37 +0100, Jacob Pedersen wrote:
> Seems like I copy over redundant stuff using my simple approach.
Hi,
you might want to do something like this:
a) copy the pages with this or the like:
PdfMemDocument::InsertPages(src, 0, src->GetPageCount());
b) traverse the pages in the new document and create XObject-s
for each of them;
c) delete all the pages with the PdfPagesTree::DeletePage() (this will
delete them from the list of pages, but they will still be part of
the document)
d) create a new page(s) and fill it/them with XObject-s as before.
Eventually, to avoid caveats of page copying (yes, there are some) you
can:
- open the source file with PdfMemDocument
- make the changes as in b), c), d)
- save the PdfMemDocument into a new file.
This approach might not always work, like with encrypted documents and
possibly some other.
Bye,
zyx
_______________________________________________
Podofo-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/podofo-users