#Linux Seven one-liners to manage PDF documents.

in #linux4 years ago

Merge many .jpg files into one pdf.
convert *.jpg doc.pdf

Rotate a single page PDF by 90 degrees right.
pdftk my.pdf cat 1east output out.pdf

Set a password.
pdftk file.pdf output file_pw.pdf userpw PROMPT

UnSet a password (two options).
pdftk file_pw.pdf output file.pdf user_pw MYPASSWD
qpdf --password=MYPASSWD --decrypt crypt.pdf de_crypt.pdf

Remove pages.
pdftk old.pdf cat 1-9 15-end output new.pdf

Merge many docs.
pdftk 1.pdf 2.pdf 3.pdf cat output 123.pdf

Reduce doc size.

gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/screen -dNOPAUSE -dQUIET -dBATCH ->sOutputFile=output.pdf input.pdf

The option /screen defines the most quality degree and size reduction factor.
Here the complete list of options from low to high quality: /screen, /default, /ebook, /printer,/prepress.

Sort:  

There is a typo in "Reduce doc size". Below the corrected version:
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/screen -dNOPAUSE -dQUIET -dBATCH -sOutputFile=output.pdf input

Coin Marketplace

STEEM 1.20
TRX 0.14
JST 0.136
BTC 57933.63
ETH 3880.10
BNB 659.50
SBD 7.35