1. Extract pages from pdf
Whether you want to split off a specific page from a pdf or extract a range of pages, this is the command for you:
pdftk full-pdf.pdf cat 13-17 output extracted-pages.pdf |
2. Concatenate two pdfs
You can merge/concatenate two pdfs with the following command:
pdftk file1.pdf file2.pdf cat output concatenated.pdf |
3. Convert jpeg to pdf
Option 1:
convert picture.jpeg -auto-orient newfile.pdf |
Option 2:
This method works with jpg, jpeg, or png files.
img2pdf picture.jpg –output newfile.pdf |
4. Make text searchable in an image pdf
If you have a pdf with pages that are only images of a written document, you won’t be able to select, highlight, or search the text. However, you can fix that by running OCR over the pdf document and adding a text layer.
ocrmypdf images.pdf images_ocr.pdf |
The OCRmyPDF package is very useful and powerful.