How to Convert JPG to PDF on Linux

JPG and PDF icons

We are going to explain how we can convert images into JPG to PDF format In an easy way. If you want to carry out the reverse action, you may also be interested in the command line program called pdfimages to dump the images contained in a PDF to JPEG format. But what we are looking for in this article is just the opposite, to go from JPG to PDF with a simple tool as we will be able to see. By the way, there are also web pages to carry out this type of conversions completely online and for free ...

To carry out this type of conversion we need to install the package in our favorite distro imagemagick or the package gscan2pdf, depending on whether we want the command line method or the graphical method. Installation is quite simple, you just have to use the package management tools used by the distribution you are using and install the package by its name as we have indicated here, and once installed, now we go to the steps you must follow to be able to transform one or more JPG images into PDF.

Convert JPG to PDF from command line:

If you have opted for the command line option and have installed the imagemagick package, in that case, once installed, we can have access to a series of quite practical command line tools and options. We are going to use the convert command to perform the conversion. The truth is that it has a multitude of options, so I recommend that you review the manual.

But the most basic thing, which is what we are looking for with this tutorial, would be to perform the conversion from the directory where the image or images are located. For example, imagine that we want to transform all the images in the / home directory to PDF or just one. For this you can use the first or the second of the commands that follow:

cd /home

convert *.jpg nombre.pdf

convert foto.jpg nombre.pdf

In the first, all the JPEG images are passed to PDF at once and in the second, only a specific one that matches that name. You can also use compression with the + compress, -rotate option to rotate the image by the degrees you specify as a parameter, etc. For example, you can rotate the image 90 degrees and add compression with the following command:

convert -rotate 90 foto.jpg +compress nombre.pdf

But if commands are not your thing, then you can move on to the next section ...

JPEG to PDF conversion using a graphical interface:

gscan2pdf

Assuming that we already have the gscan2pdf program, let's see that the procedure is quite simple. The steps are:

  1. We open gscan2pdf.
  2. We add the images or we select the directory where the images we want to convert are located.
  3. Once added, we can reorder them by dragging them from the main screen of the application, from the list of images that appears just to the left.
  4. Once put in order we can click on the button Save to save.
  5. Now a screen will appear where we can choose many Options, including changing the metadata of the PDF, adding a name, date, type, author, source, etc. Although it is not necessary to fill them if we do not need it. What is important is to select All if we want to convert all the images as PDF pages and in the output format choose the PDF, since it supports other formats ...
  6. We accept and it will generate the PDF with our images.

I hope it has helped you, for more suggestions or doubts, do not forget to leave your comments...


The content of the article adheres to our principles of editorial ethics. To report an error click here!.

6 comments, leave yours

Leave a Comment

Your email address will not be published.

*

*

  1. Responsible for the data: AB Internet Networks 2008 SL
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.

  1.   laurencio said

    Very good. Thanks for the info.
    I used the option
    convert * .jpg name.pdf
    and it did just what it needed: converting and unifying all jpg images into a single pdf file.

  2.   JUAN ANTONIO DIAZ said

    Very good post, it was very helpful. Thanks for sharing.

  3.   Alberto said

    The "easy" followed by command line seems contradictory to me. It is taken for granted that we all know a lot of things about the terminal, the sudo, the happy folder where to put the files, etc. but I always run into some problem.

    Easy would be something visual and intuitive, the rest is still the linux of glasses.

  4.   debianitaferoz said

    the best tool:
    pip install img2pdf
    img2pdf -o output.pdf input.jpg

  5.   Miguel Angel said

    Great app, thanks for the tip.

  6.   Miguel Angel said

    Great app, thank you very much.

bool (true)