tavinus / pdfScale

Bash Script to Scale and Resize PDFs using Ghostscript
MIT License
246 stars 37 forks source link

How to decrease pdfscale execution time? #41

Closed leandrocombr closed 3 months ago

leandrocombr commented 1 year ago

Hello,

How do I decrease the execution time of pdfscale

command: pdfscale -r A4 --vert-align center --hor-align center -s 0.92 --image-downsample Bicubic --image-resolution 144 --pdf-settings screen int.pdf out.pdf

Runtime: 0m58708s

Centos7 memory: 252gb Processor: Intel(R) Xeon(R) CPU E5-2680 v4 @ 2.40GHz

GPL Ghostscript 9.25 pdfscale v2.5.8

tavinus commented 1 year ago

You could export the command with the dry-run option and run ghostscript directly to see if it makes any difference. But the only thing we do prior to that is find out the paper sizes (which has several modes that you can try as well). If there is little to no difference in time, I suppose we can't do anything. It is just the time GS takes to convert it. Also, since you are resizing and scaling, there are 2 GS calls you will have to make (with an intermediate file).

Edit: How big was the file?