PDF cheatsheet

Some common PDF-related commands I find myself doing and forgetting.

# Convert a bunch of images to an OCR'd PDF
# Relies on my own img2pdf script:
#  http://kueda.net/blog/2015/06/20/converting-images-of-text-to-searchable-pdfs/
#  https://gist.github.com/kueda/c02b9f3f5a0f03f41524
img2pdf *.jpg
 
# Make a PDF of scanned page images searchable
# pdfimages comes with Poppler, which you'll need to get img2pdf working
pdfimages PDF_NAME IMAGE_NAME_ROOT
mogrify -negate *.pbm # pdfimages seems to invert colors for some reason
img2pdf *.pbm

Comments are closed.