Another cool trick you can do with ubuntu, on ubuntu you can convert JPG file into PDF file, you can do this from the command line. This trick will help you to convert jpg to pdf vice-versa without using the Internet.
There is a command called ‘convert‘ on ubuntu that is used to convert lots of stuff, including JPG to PDF, but first, let’s install the ‘ImageMagick‘ package to make sure everything runs smoothly.
Steps to Convert jpg to pdf Ubuntu:
(1) Open Terminal and type below command.
sudo apt-get imagemagick
(2) Ones installed we are ready to convert JPG file and turn it into PDF file, you can use ‘convert‘ command like this:
convert [jpg file] [pdf file]
(3) If you got an Error like @error/constitute.c/WriteImage/1037 then follow the step below to solve the error :
- Open Terminal and type the Command cd/etc/ImageMagick-6/
- Now type sudo gedit policy.xml and hit enter.
- policy.xml file will open in gedit and now search for “PDF” word in the file.
Also Read: Use wifi and Hotspot together in Android
- Now change this line <policy domain=”coder” rights=”none” pattern=”PDF” /> to <policy domain=”coder” rights=”read|write” pattern=”PDF” /> and save the file and exit the terminal.
- Now again try the convert command and you will not see any error.
convert image.jpg output.pdf
convert crazytechgo.jpg crazytechgo.pdf
(4) It is also possible to add multiple JPG files and converted into a single PDF file, here’s an example:
convert photo1.jpg photo2.jpg photo3.jpg photo-album.pdf
(5) We can also convert pdf file into jpg using the convert command and the pdf file can be converted into any image extension like jpg , jpeg , png etc.
convert file.pdf img.jpg
About Imagemagick :
ImageMagick is a free and open-source software suite for displaying, creating, converting, modifying, and editing images. Use of ImageMagick is to create, edit, compose, or save bitmap images. It can read and write images in a variety of formats, including PNG, JPEG, GIF, HEIC, TIFF, DPX, EXR, WebP, Postscript, PDF, and SVG. You can also use ImageMagick to resize, flip, mirror, rotate, distort, shear and transform images, etc.
The current release is ImageMagick 7.0.10-3. It runs on Linux, Windows, Mac Os X, iOS, Android OS, and others.