Page 1 of 1

PXCp_InsertPagesTo file size

Posted: Thu Oct 05, 2017 12:23 pm
by scoberry
I'm trying to get a page from a multipage PDF. XCPro40Demo has a good illustration of the functionality I want, using PXCp_InsertPagesTo. I ran the demo and it works, but the file size for some of the pages is quite large. I have a 43 page PDF that's ~3.4MB, and the single-page files range as high as ~3.3MB.

Using PDFXEdit and Document | Extract Pages does better: the largest page is ~.1MB.

Any ideas what I could try to get the file size from PXCp_InsertPagesTo down? I tried running Optimize after extracting the pages, but it made the file slightly bigger.

Re: PXCp_InsertPagesTo file size

Posted: Thu Oct 05, 2017 12:32 pm
by Tracker Supp-Stefan
Hello scoberry,

Welcome to our forums and thanks for your post.
It would be best if you can provide us with one such sample file, so that we can investigate why the size remains as it is.

I've also moved your topic to the correct forum section - as you had it posted in the end user one.

Regards,
Stefan

Re: PXCp_InsertPagesTo file size

Posted: Thu Oct 05, 2017 1:23 pm
by scoberry
Thanks.

I don't see a way to attach a file in the forum. I've put the file at https://ufile.io/wqunt.

It's a 43-page document, and the file sizes get larger for the later pages (they strictly increase from one page to the next, as if it's including data from previous pages). So page 43 is the worst, 42 is second worst, etc.

The repro:
1. Run XCPro40Demo.
2. Select "Extract pages", click Next.
3. Open the document from the link above.
4. Set "Selected pages" to 43.
5. Select an output doc path and click OK.
The output file is pretty big (~3.3MB).
6. Run PDFXEdit.
7. Open the document from the link above.
8. Document | Extract Pages.
9. Choose Pages = 43.
10. Pick a destination path and click OK.
The output file is ~88KB.

Re: PXCp_InsertPagesTo file size

Posted: Fri Oct 06, 2017 8:15 am
by Lzcat - Tracker Supp
Hi scoberry.
Problem is with your file - it contains a lot of images, and all of them are listed as used on each page (when in fact - not).
Unfortunately old library does not handle this case and copy all listed resources, and this will be not changed. You can try use Low-Level API to remove not needed resources from page resources (in original document or in inserted copy - it does not matter).
Another option - switch to new SDK.
HTH.