Viewers
Evince
By default, Evince has a very annoying zoom limit Fix it with:
$ gsettings get org.gnome.Evince page-cache-size
uint32 512
$ gsettings set org.gnome.Evince page-cache-size 1024
Warning - may use a lot of RAM!
Merge/Rearrange multiple PDFs
GUI
pdfarranger Recently updated
sudo apt install pdfarranger
cli
pdftk
Install:
sudo pacman -S pdftk
Merge PDFs:
pdftk file1.pdf file2.pdf file3.pdf cat output merged.pdf
pdfunite
- Included in poppler Arch package
- Warning: Produces PDF files which don't validate with i.e.
qpdf --check
pdfunite in-1.pdf in-2.pdf in-n.pdf out.pdf
Reduce PDF size
Usage:
ps2pdf input.pdf output.pdf
Convert images to PDF
With img2pdf
sudo apt install img2pdf
DINA4 portrait:
img2pdf --pagesize A4 --border 2cm:2.5cm a.png > a.pdf
DINA4 landscape:
img2pdf --pagesize A4^T --border 2cm:2.5cm a.png > a.pdf
Issues:
- Can't combine multiple images into one pdf page, each image creates a new PDF page
With imagemagick
Convert and scale jpg to DINA4 pdf:
convert a.jpg -compress jpeg -resize 1240x1753 -extent 1240x1753 \
-gravity center -units PixelsPerInch -density 150x150 a.pdf
convert b* -compress jpeg -resize 1240x1753 -extent 1240x1753 \
-gravity center -units PixelsPerInch -density 150x150 b.pdf
Combine multiple images in one PDF page:
montage src* -mode concatenate -tile 1x -resize 500x \
-page a4 -gravity center dst.pdf
Extract images from PDF
pdfimages -png document.pdf .
Convert PDF to high quality image
Convert PDF to image with high resolution
convert -verbose -density 150 -trim -quality 100 -flatten -sharpen 0x1.0 \
image.png
PDFTK
apt install pdftk-java
Remove password from pdf
How to remove the password from a PDF
qpdf --password=YOURPASSWORD-HERE --decrypt input.pdf output.pdf
Or: Open the protected file and use ctrl+p or use print optiont to print the file, now save the file as pdf.