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

How to remove page numbers (footer and header) #54

Open
igarca opened this issue Sep 2, 2023 · 1 comment
Open

How to remove page numbers (footer and header) #54

igarca opened this issue Sep 2, 2023 · 1 comment

Comments

@igarca
Copy link

igarca commented Sep 2, 2023

Hi,
Thank you very much for this tool. I just switched to Linux and this is quite useful for me. I print a lot of academic papers and I like to remove margins to increase font size and then print 2 pages per sheet to save paper. I don't have a lot of bash knowledge but I managed to automatize this process.
However, I've some issues I'm not able to solve. I'm sorry if they're pretty easy, I spent many hours trying to get this work and writing here has been my last resort.

  • When I use pdfcropmargins, something like this (https://i.imgur.com/ZdJCHPy.png) converts to this (https://i.imgur.com/EjZVfcq.png). I'd like to find out the most eficient way of getting rid of the blank space of the page number.
    Using this cropmargins -p 10 -ap4 0 50 0 0 Document.pdf gives me Warning in pdfCropMargins: The cropbox could not be written to page 20. The error is: rect not in mediabox, but cropmargins -p 10 -ap4 0 40 0 0 Document.pdf works perfectly.
    The problem is that I'd have to set the ap4 manually, which would not allow me to automatize since that value will be different depending on the footer size of the document. Is there any other way to do this? This same happens with headers. I'd like to keep only the relevant part (https://i.imgur.com/hxQs82C.png).

EDIT: Okay, I kept trying with many more pdfs and it seems it does a great job with most academic papers. It only has problems when there is a large blank space between the content and the headers/footers. In these cases, what would be the best option? Choosing the ap4 value by eye?

Thank you very much and sorry if these are noob questions. Btw this may obvious, but I had to install python3-pip along with python3-tk.

@igarca igarca changed the title How to remove page numbers How to remove page numbers (footer and header) Sep 2, 2023
@abarker
Copy link
Owner

abarker commented Sep 9, 2023

One possibility would be to run the program twice. On the first run, trim the file to a tight bounding box on the bottom with something like -p4 100 0 100 100. Then on the next run you could apply a small pre-crop, a little over the point size of the page numbers.

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

No branches or pull requests

2 participants