pdfCropMargins icon indicating copy to clipboard operation
pdfCropMargins copied to clipboard

original file size unchanged

Open wdysun opened this issue 4 years ago • 1 comments

Thanks this is an amazing tool! Reading the documentation I am not sure I can do the following: Suppose I have a pdf with orginal paper size = W x H. Now I want to crop all possible white space but my output file should be still rescaled to have a paper size WxH

Is that possible?

wdysun avatar Mar 20 '20 16:03 wdysun

It isn't currently possible to rescale documents. It wouldn't be too hard to add and is on the list of possible enhancements to implement. The problem is that if you rescale tightly-cropped text and images (such as from cropping with the -p 0 option) to fit a preset size then the text and images can become weird and distorted unless the new page ratio matches the cropped page ratio. If the pages crop to different sizes then the distortion wouldn't even be consistent across the pages.

Probably the closest you can come with the current settings is to use the options

-p 0 -s -u -spr W:H

This crops the pages as much as possible without clipping text, forces them to all have the same size, ensures that each page is cropped by the same amount, and then adds the minimal margins to return the document to have the page ratio W/H like the original. Most PDF viewers can zoom the pages to fill the available page area. You could also try it without the -u option.

abarker avatar Mar 21 '20 05:03 abarker