How do I resize a PDF?
How do I resize a PDF?
I have 100 pdf files in a folder in A0 format I'd like to scale them to A3.
I have tried various methods but none of them worked. My goal is to create a script (preferably in python) to scale all the files in A3.
I tried to use PIL but my version of python doesn't support it.
2 Answers
2
you can write commands on windows command processor
to do these functions :
-Merge PDF files together, or split them apart
-Encrypt and decrypt
-Scale, crop and rotate pages
-Read and set document info and metadata
-Copy, add or remove bookmarks
-Stamp logos, text, dates, page numbers
-Add or remove attachments
-Losslessly compress PDF files
it can work also in different OS such as / MAC / Ubunto / Linux
scale command example :
cpdf -scale-to-fit a3portrait in.pdf -o out.pdf
using this tool Coherent PDF Command Line Tools , you may download it from here click here to open link
you can as well use python script to execute the code for you on the command processor / terminals .
hope my post helped you , good luck
Thanks. I downloaded it and launched, when I use command processor I get 'command" is not recognized as an internal or external command, operable program or batch file'
– Azerty
Aug 27 at 9:14
its working bro , i think you are missing the way of using it , when you download the tool , extract it on C:mypdffiles navigate to windows path ( assuming you are using windows) by typing cd C:mypdffilescpdf-binaries-masterwindows you will find in there the cpdf.exe tool , so within the same folder , place your pdf file and use the command from the same path , for example after navigating to the path above put in.pdf file within same folder and run cpdf in.pdf 1-3,12-end -o out.pdf you cannot use the tool until you copy it on folder of where you are going to run the command
– Ahmed Shahin
Aug 27 at 11:40
there is manual documents too please read them for better understanding on the same folder @Azerty
– Ahmed Shahin
Aug 27 at 11:43
by the way , implementing it the way it works now makes it more easier to be controlled with other languages such as python for example as you can integrate it within your program code and use any where along when you type the commands
– Ahmed Shahin
Aug 27 at 11:49
You could try the linux pdftk
program (although it might even be available on Windows, i am not sure). Once installed, you can use the command below to convert an A0 pdf to an A3 pdf
pdftk
convert -page a0 infile.pdf -page a3 outfile.pdf
I think this answer has value
– Sascha Gottfried
Aug 27 at 8:17
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
So which Python libraries have you tried and why did your attempts fail? Please read How to create a Minimal, Complete, and Verifiable example and edit your question accordingly.
– Mr. T
Aug 27 at 8:17