Comment by Beijinger

1 year ago

#!/bin/bash

# Convert images to PDF

img2pdf *.jpg -o images.pdf

# Merge PDFs

pdfunite file1.pdf file2.pdf images.pdf merged.pdf

# Compress

gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/ebook \ -dNOPAUSE -dQUIET -dBATCH -sOutputFile=compressed.pdf merged.pdf

# Remove unwanted pages (e.g., page 3)

pdftk compressed.pdf cat 1-2 4-end output final.pdf

# Add page numbers

pdfjam final.pdf --outfile final_numbered.pdf --pagecommand '{}' --landscape

You know what. I will share my script in the morning.

I used scantailor go scan a book. That gave out tif files.

So I built a script to convert them to jpg, then merge into PDF. Then OCR and add the text layer on PDF. Then compress.

I know this for a niche automation..... web OTOH where normies reside and are scared by terminal, it wont work.

Been using pdftk for years now but im only person who can use it in my office.

I'll be adding compression support for BreezePDF, so this can be done in a click

  • Merge/compress with Max size / color-greyscale/ remove pages / multi format import like PDF and images as input / export options/ export into multiple files if file size exeeds certain size.

    And like my earlier comment, a way to define these multiple steps in a flow so that people can do multiple steps with a single file without having to learn command