Skip to content

Instantly share code, notes, and snippets.



Created Mar 11, 2020
What would you like to do?
Extract Images From PDF / Build PDF From Images / Remove PDF White Margins (Ubuntu)
#!/usr/bin/env bash
# Extract images from a PDF:
sudo apt-get install poppler-utils
pdfimages -all input.pdf images/image
# Build PDF from images:
sudo apt install img2pdf
img2pdf --output d.pdf images/image*.jpg
# Extracting the images from a PDF and then rebuilding it removes white margins surrounding images.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.