Cli Convert Image to Pdf (img2pdf)

Aug 28, 2020

Install

sudo apt install img2pdf

Check if latest version

img2pdf --version

If you need the latest version, need to install via pip

sudo apt-get remove img2pdfpip3 install --upgrade --force-reinstall img2pdf

If you get the following warning

WARNING: The script img2pdf is installed in '/home/USER/.local/bin' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.

Edit ~/.bashrc and add the following

export PATH=~/.local/bin:$PATH

Reload ~/.bashrc

source ~/.bashrc

Usage

img2pdf ~/test.png -o test.pdf

If you get the following error

ERROR:root:error: Invalid rotation (0)

The tool will not accept image with invalid rotation exif, so you need to fix it to proceed.

❤️ Is this article helpful?

Buy me a coffee ☕ or support my work via PayPal to keep this space 🖖 and ad-free.

Do send some 💖 to @d_luaz or share this article.

✨ By Desmond Lua

A dream boy who enjoys making apps, travelling and making youtube videos. Follow me on @d_luaz

👶 Apps I built

Travelopy - discover travel places in Malaysia, Singapore, Taiwan, Japan.