Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there a limit on the number of pages in a file? #106

Open
zollybig opened this issue Mar 14, 2025 · 6 comments
Open

Is there a limit on the number of pages in a file? #106

zollybig opened this issue Mar 14, 2025 · 6 comments

Comments

@zollybig
Copy link

Tell me, please, are there any restrictions on the number of pages in сpdf? I'm trying to make 6DUP on a file of 9000 pages, 26 MB in size, and the process is taking a very long time, I couldn't wait for the end.
May be its impossible to process so many pages using cpdf and I need to split file before processing?

@johnwhitington
Copy link
Contributor

There is no formal limit, but DUP is new functionality, and there might be a complexity-blowup which we might be able to fix.

Can you supply (privately, if necessary) the example file?

@zollybig
Copy link
Author

Of course, for the development of such a useful utility. But, indeed, it is better privately, since these are not my files, I am just experimenting with them. We corresponded by e-mail, I will send you a link to the archive

@zollybig
Copy link
Author

sent

@zollybig
Copy link
Author

6DUP works. cpdf not hung. combine_nopipe.cmd start DUP an 23:30:41 and end at 1:12:53. as it turns out, this is the slowest part of the job

start time 23:30:10,91
"C:\src\футболки\all_temp.pdf"
"C:\src\футболки\all_comb.pdf"
mediabox start 23:30:10,92
mediabox end, shift start 23:30:14,68
shift end, rotate start 23:30:37,87
rotate end, DUP start 23:30:41,75
DUP end, impose start 1:12:53,68
impose end, mbox start 1:18:00,99
mbox end, shift start 1:18:03,12
shift end, stamp start 1:18:51,51
end time 1:19:13,68

@zollybig
Copy link
Author

I am once again delighted with cpdf

@johnwhitington
Copy link
Contributor

johnwhitington commented Mar 14, 2025

I experimented:

$ time ./cpdf out.pdf 2DUP -o out2.pdf

real 2m22.411s
user 2m22.156s
sys 0m0.228s

$ time ./cpdf out.pdf 4DUP -o out2.pdf

real 14m44.241s
user 14m43.197s
sys 0m1.059s

$ time ./cpdf out.pdf 6DUP -o out2.pdf

real 35m2.467s
user 34m59.228s
sys 0m2.788s

So, clearly something somewhat exponential going on here. Let's keep this bug open, and I'll try to get it linear in the future.

(By the way, I ran cpdf -squeeze in.pdf -o out.pdf first to remove duplicate objects from the file. I don't know if this made it faster, but it did make it smaller. See what you find...)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants