Ubuntu – Right-click convert PDF to JPG

image processingimagemagickpdf

Looking for an easy way for one of my employees to convert PDF files to a JPG. I can do something in CLI, but he can't. It has to either be automated (less desirable), or a right click convert thing.

The reason being so that he can download a PDF from his email, and print it on a Zebra printer in glabel.

Suggestions?

Best Answer

A right-click solution can also be nice in that it is faster and works also if you are off line.

No desktop environment was specified in the original question, so this answer will also be generic. Several file managers allow to define custom actions, which then can be executed by right-clicking the file.

A basic script to convert a PDF to jpg can be a one liner using one of several tools available. Using imagemagicks convert for example:

convert input.pdf output.jpg

will convert input.pdf into one or multiple jpeg files, sequentually numbered in the latter case.

Then it will depend on the file browser how this command can be incorporated into a script, and what placeholders need to be given to have input.pdf automatically substituted by the actual file name. For the default filemanager of Ubuntu 18.04, a how-to about adding your own script is provided here. A more powerful option that is not officially supported by the nautilus developpers, is provided by filemanager-actions. Users of Thunar can start here.

Related Question