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

original file size unchanged #18

Open
wdysun opened this issue Mar 20, 2020 · 1 comment
Open

original file size unchanged #18

wdysun opened this issue Mar 20, 2020 · 1 comment

Comments

@wdysun
Copy link

wdysun commented Mar 20, 2020

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?

@abarker
Copy link
Owner

abarker commented Mar 21, 2020

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.

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

No branches or pull requests

2 participants