On Mon, 2019-02-18 at 10:40 +0100, Jacob Pedersen wrote: > // PdfXObject* xobj = new PdfXObject(spage- > >GetObject()); // <- Exception: ePdfError_InvalidDataType (20) > PdfXObject* xobj = new PdfXObject(spage- > >GetContentsForAppending()); // <- Nothing, except the lines, gets > drawn on target, but Acrobat Reader shows an error when opening > destination PDF
Hi, as the first step you need to copy pages from the source PDF to the destination PDF, it copies all needed, including resources (copy all in one step, rather than one-by-one, especially if you want all pages). Then you need to work with those pages in the destination PDF. The GetContentsForAppending() is really not what you want. The similar code I gave a link to earlier shows you how to do this. You can avoid litePDF, it is "just a wrapper" on top of PoDoFo in this code, thus you can look into what the litePDF does and mimic that. Bye, zyx _______________________________________________ Podofo-users mailing list Podofo-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/podofo-users