On Sun, 2014-05-04 at 14:13 +0200, Christophe Meyer wrote: > I am developping a simple software. As a first basis, I would like to > duplicate a pdf file that has been created by my printer (a scanned > document). It consists of a file of 40 pages. It weights 10 Mb and > each page of the pdf document is an image of a scanned document’s > page. > > In my program, I am just copying each page from the original pdf (I > load it in a PdfMemDocument) and then inserts it in another > PdfMemDocument with InsertPage. > > I just do a Write() at the end. > > The file created at the end weighs more than 500 MB!!
Hi, check the documentation and comments around the functions you use for the page insertion. The PoDoFo doesn't merge resources, thus whenever you add single page to a new document it copies whole document (or "only" all resources, I dot recall precisely) to the new file, thus nothing is missing when the inserted page is drawn. I suggest to copy all pages in the destination document at once, convert each into an XObject, then delete them all and reorder them as you wish, by drawing the XObject into the new page (you can even shrink it and so on). This way you'll not duplicate the resources (by the way, inner images are also resources, which explains the size increase). Bye, zyx -- http://www.litePDF.cz i...@litepdf.cz ------------------------------------------------------------------------------ Is your legacy SCM system holding you back? Join Perforce May 7 to find out: • 3 signs your SCM is hindering your productivity • Requirements for releasing software faster • Expert tips and advice for migrating your SCM now http://p.sf.net/sfu/perforce _______________________________________________ Podofo-users mailing list Podofo-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/podofo-users