Programs intend to save a whole page for everything that is saved as PDF, even if the content just takes 5% of a page. If you then have to crop a large batch of PDFs manually it is really a pain, but Inkscape offers a nice way to do this using the command line.
Just create a batch file i.e. semiautocrop.bat, put the following code inside (don’t forget to change to path to you Inkscape folder, just place the path without brackets i.e. c:inkscape) and place it into the folder of your PDFs.
1 |
for /r "%cd%" %%i in (*.pdf) do "[path-to-inkscape.exe]" --verb=FitCanvasToSelectionOrDrawing --verb=FileSave --verb=FileClose "%%i" |
The batch will run through all of the PDFs in the current folder and open Inkscape to crop the PDFs. Unfortunately I didn’t find a way to omit the dialogs for importing the PDF, saving and closing Inkscape without saving a SVG.
But nonetheless it’s way faster then doing everything manually. If you have an idea how to improve this leave me a comment.