abarker / pdfCropMargins

pdfCropMargins -- a program to crop the margins of PDF files
Other
361 stars 35 forks source link

Is the completely remove the margin or simply add a mask? #51

Open fuzihaofzh opened 1 year ago

fuzihaofzh commented 1 year ago

Thanks for the great tool. I just wonder whether it completely removes the margin or simply adds a mask like Preview in Mac?

abarker commented 1 year ago

It doesn't actually remove any of the PDF page, it just changes the mediabox and cropbox properties of the PDF. Most PDF viewing software then displays the cropped page rather than the full page. This is how it implements the --restore operation: it just saves the old box values in the artbox and can later restore them

fuzihaofzh commented 1 year ago

@abarker Thanks for the detailed answer, May I know if it possible to add an option to totally remove the margin. In my case, when I embed the corped pdf into my paper, the margin will resume and show some wiered appearance if I convert the paper into PDF/A-2b format.

Shohreh commented 1 year ago

To actually remove the data from the file, try "mutool trim", which was introducted recently.

abarker commented 1 year ago

As I noted in your other issue, I'm not sure how mutool is implementing the trim and if it is actually different from simply modifying one or more of the PDF boxes like pdfCropMargins already does.