Tuesday, January 1, 2019

save / print pdf without margin

Why?
pdf, including ones at research site ssrn, in general have huge margin.  when you wanna print 2 pages per sheet, the text become smaller with a lot of unnecessary white space for the margin

What do you need?
pdfcrop, which is available at ubuntu, but not centos7 afaik at the time of writing

How?
pdfcrop -h
pdfcrop <input.pdf> <output.pdf>

Appendix:
What if you don't have ubuntu?
if you have centos7 running on virtualbox with windows host, here's what I did:

  1. download ubuntu 18 desktop installation iso
  2. Virtualbox, existing vm, storage, optical drive
    1. select the downloaded iso
    2. check Live CD/DVD box
  3. start VM
  4. choose "Try ubuntu" after it boots from disc
  5. Follow https://askubuntu.com/questions/378558/unable-to-locate-package-while-trying-to-install-packages-with-apt to update package download source
  6. Open a terminal in ubuntu
    1. sudo apt-get install texlive-extra-utils
    2. pdfcrop <input.pdf> <output.pdf>
  7. ubuntu map windows host's shared drive
    1. netstat -nr to see window host's ip address from ubuntu
    2. ubuntu "Files" app, which has a folder icon
    3. connect to Server by entering smb://<windows ip>
  8. drag and drop <output.pdf> to shared folder