Linux make pdf from images

Конвертирование jpg в pdf в Linux

Формат jpg несомненно является самым популярным графическим форматом в интернете, однако в некоторых случаях удобнее использовать pdf, так как он может включать как растровую, так и векторную графику. Поэтому качество печати изображений jpg зависит только от их разрешения и степени сжатия, в то время как векторные pdf-файлы можно печатать любого размера. Кроме того, pdf-файлы с текстовым слоем поддерживают поиск по содержимому и могут содержать больше метаданных, чем jpg.
В Linux для конвертирования jpg в pdf вы можете использовать ImageMagic или GhostScript.

Конвертирование jpg в pdf с помощью ImageMagick

Для начала установите ImageMagick.

В пакет ImageMagick входит утилита convert, которая позволяет конвертировать jpg в pdf. Эта команда масштабирует изображение таким образом, чтобы оно соответствовало размеру страницы. Конвертирование осуществляется с помощью команды:

Если вы хотите конвертировать несколько изображений jpg в один pdf-файл (с несколькими страницами), это делается с помощью команды:

Утилита convert также поддерживает различные операции редактирования изображения перед его конвертированием в формат pdf.

С помощью опции «-page» команды convert можно задать размер страницы. Если размер больше, чем размер исходного изображения, оно будет размещено в левом нижнем углу страницы.

Можно также задать размер изображения:

Изменить размер изображения:

Конвертирование jpg в pdf с помощью Ghostscript

Сначала установите ghostscript.

Для конвертирования используется команда gs вида:

Конвертирование нескольких изображений jpg в один файл pdf осуществляется с помощью команды:

Источник

How To Convert Multiple Images To PDF In Ubuntu Linux

Last updated October 28, 2019 By Abhishek Prakash 72 Comments

You have several documents or images scanned individually and you need to save multiple images to one PDF file. If you Google, you will find many online websites for this purpose. But they are either not free or they will put their watermark on the final PDF file. You don’t want it, do you?

I had this need when I had to apply for a job and they required me to upload a single PDF file consisting of several documents. My problem was that I had documents scanned individually but not in one file. It’s just one of the example where you may need to convert multiple image files in one PDF file.

If you are using Ubuntu then many people would suggest to use the command line tool Image Magic. But if you prefer a GUI tool over command line, gscan2pdf that is the perfect tool for merging multiple images into one PDF file. We shall see both methods in this tutorial.

1. The GUI way to convert multiple images to PDF in Ubuntu Linux

In this tutorial we’ll see how to convert multiple images to PDF with gscan2pdf. Though the tutorial is performed in Ubuntu 14.04, it should be valid for earlier or newer Ubuntu versions as well as other Linux distributions based on Ubuntu such as Linux Mint and elementary OS.

Читайте также:  Выполнение команды по времени linux

Install gscan2pdf in Ubuntu:

Open terminal (Ctrl+Alt+T) and use the following command to install gscan2pdf:

How to convert multiple images to PDF with gscan2pdf:

Once installed, open gscan2pdf by searching for it in Unity Dash:

Once gscan2pdf is opened, you can select all the required files in it by clicking on the Open Files. By default it is arranged in alphabetical order but you can drag and drop to reorder the images as per your choice. Once done, you can click on the Save icon to save the files to PDF.

When you hit the save button, the next screen might look confusing. Actually it provides you option of putting metadata in the document such as author, date etc similar to a word document. If you just want a PDF file, hit the save button. Since by default the output file is PDF, you don’t need to bother a lot here. Just choose where to save the converted file.

2. The command line way to convert multiple images to PDF in Ubuntu Linux

If you want to go the command line way, you can use ImageMagick. It’s very easy to convert several images into one PDF file this way as well.

Open a terminal and install ImageMagic using the command below:

Once you have it installed, use the ‘convert’ command line tool of ImageMagic. Just provide the paths to individual images and at the end of the command, name the output file. For example, something like this:

That’s it. Nothing more to be done. Cool isn’t it? 🙂

Did it work for you?

I hope this article helped you to merge multiple images into one PDF in Ubuntu Linux. If you are further interested, check this article to know how to edit PDF files in Ubuntu Linux.

Questions, suggestions, a word of thanks is always encouraged.

Like what you read? Please share it with others.

Источник

Как конвертировать JPG в PDF в Linux

Мы собираемся объяснить, как мы можем преобразовать изображения в JPG в формат PDF В легкий путь. Если вы хотите выполнить обратное действие, вас также может заинтересовать программа командной строки под названием pdfimages, которая выгружает изображения, содержащиеся в PDF, в формат JPEG. Но в этой статье мы ищем прямо противоположное — перейти от JPG к PDF с помощью простого инструмента, как мы увидим. Между прочим, есть также веб-страницы, на которых можно выполнять такие преобразования полностью онлайн и бесплатно .

Для выполнения этого типа преобразований нам необходимо установить пакет в нашем любимом дистрибутиве. ImageMagick или пакет gscan2pdf, в зависимости от того, нужен ли нам метод командной строки или графический метод. Установка довольно проста, вам просто нужно использовать инструменты управления пакетами, используемые в используемом вами дистрибутиве, и установить пакет по его имени, как мы указали здесь, и после установки теперь мы переходим к шагам, которые вы должны выполнить, чтобы иметь возможность для преобразования одного или нескольких изображений JPG в PDF.

Читайте также:  Windows firewall blocking all ports

Конвертируйте JPG в PDF из командной строки:

Если вы выбрали опцию командной строки и установили пакет imagemagick, в этом случае после установки у нас будет доступ к ряду довольно практичных инструментов и опций командной строки. Мы собираемся использовать команда convert для выполнения преобразования. На самом деле у него множество опций, поэтому я рекомендую вам ознакомиться с руководством.

Но самая основная вещь, которую мы ищем в этом руководстве, — это выполнить преобразование из каталога, в котором находится изображение или изображения. Например, представьте, что мы хотим преобразовать все изображения в каталоге / home в PDF или только одно. Для этого вы можете использовать первую или вторую из следующих команд:

В первом случае все изображения JPEG передаются в PDF сразу, а во втором — только конкретное изображение, соответствующее этому имени. Вы также можете использовать сжатие с опцией + compress, -rotate, чтобы повернуть изображение на градусы, указанные в качестве параметра, и т. Д. Например, вы можете повернуть изображение на 90 градусов и добавить сжатие с помощью следующей команды:

Но если команды не для вас, то можете переходить к следующему разделу .

Преобразование JPEG в PDF с использованием графического интерфейса:

Предполагая, что у нас уже есть программа gscan2pdf, посмотрим, что процедура довольно проста. Шаги следующие:

  1. Мы открыты gscan2pdf.
  2. Добавляем изображения или мы выбираем каталог, в котором находятся изображения, которые мы хотим преобразовать.
  3. После добавления мы можем измените их порядок, перетащив их на главном экране приложения из списка изображений, который появляется слева.
  4. После того, как приведем в порядок, мы можем нажать на кнопку Сохраните, чтобы сохранить.
  5. Теперь появится экран, на котором мы можем выбрать много opciones, включая изменение метаданных PDF-файла, добавление имени, даты, типа, автора, источника и т. д. Хотя заливать их не обязательно, если нам это не нужно. Важно выбрать Все, если мы хотим преобразовать все изображения как страницы PDF, а в выходном формате выбрать формат PDF, поскольку он поддерживает другие форматы .
  6. Aceptamos и он сгенерирует PDF с нашими изображениями.

Надеюсь, это помогло вам, для получения дополнительных предложений или сомнений не забудьте оставить ваши комментарии.

Содержание статьи соответствует нашим принципам редакционная этика. Чтобы сообщить об ошибке, нажмите здесь.

Полный путь к статье: Любители Linux » SPA-программы » Как конвертировать JPG в PDF в Linux

Источник

Convert images to PDF on Linux

In this post, we’ll take a look at three different ways on how to convert images to PDF file on Linux.

Gscan2pdf

The first option on our list is to use gscan2pdf app. Gscan2pdf is an open-source app available on all Linux distros and makes converting images to PDF a breeze. We can install it by going to the software centre and searching for gscan2pdf .

After opening the app, click on a folder icon to load images. An error pop-up might show up informing you that you don’t have scanning devices. That’s not a problem, just close it.

Having loaded images, you can customize them if you would like to do so.

The top toolbar includes editing options like:

  • Flipping
  • Rotating
  • Renumbering
  • and much more!

Once we are done with editing, we can convert images into a single PDF:

File → Save → Select Document type to PDF → Save.

ImageMagick

ImageMagick is a CLI tool which allows you to convert images to PDF. As a CLI tool, it’s much faster than Gscan2pdf. On top of that, we can automate the whole process!

Читайте также:  Как открыть файл mkv windows media player

We can install it with the following command:

After installing it, convert your images to PDF with the following command:

The command above might yield an “operation not allowed” error. Fortunately, we can easily fix it by executing:

After applying the fix, re-run the conversion command!

LibreOffice

The last option on our list is LibreOffice. LibreOffice Draw provides us with a bit cumbersome, but still possible way to convert images to PDF.

The biggest advantage of this approach is also its biggest disadvantage — the ability to arrange images on a page manually. If you just want to have each image on its page without much tweaking, then you should not use LibreOffice Draw for this.

You can import images in LibreOffice Draw by dragging and dropping them from your file manager and customize them as you wish.

Once we’ve finished with editing, we can export our work as PDF:

File → Export as → Export as PDF → Export

Conclusion

In this post, we’ve explored three different ways to convert images to PDF and discussed the pros and cons of each. What is your approach? Share your thoughts with us in the comments section below. 👇

Источник

☩ Walking in Light with Christ – Faith, Computing, Diary

Create PDF file from (png, jpg, gif ) images / pictures in Linux

Tuesday, 14th September 2010

I’ve recently received a number of images in JPEG format as a feedback on a project plan that was constructed by a team I’m participating at the university where I study.

Somebody from my project group has scanned or taken snapshots of each of the hard copy paper feedback and has sent it to my mail.

I’ve received 13 images so I had to open them one by one to get each of the Project Plan to read the feedback on the page this was really unhandy, so I decided to give it a try on how to generate a common PDF file from all my picture files.

Thanksfully it happened to be very easy and trivial using the good old Image Magick

In order to complete the task of generating one PDF from a number of pictures all I did was.1. Switch to the directory where I have saved all my jpeg images

2. Use the convert binary part of imagemagick package to generate the actual PDF file from the group of images

# convert *.jpg outputpdffile.pdf

If the images are numbered and contain many scanned pages of course you can always pass by all the images to the /usr/bin/convert binary, like for instance:

# convert 1.jpg 2.jpg 3.jpg 4.jpg 5.jpg outputpdffile.pdf
Even though in my case I had to convert to PDF from multiple JPEG (JPG) pictures, convertion with convert is not restricted to convert only from JPEG, but you can also convert to PDF by using other graphical file formats.

For instance to convert multiple PNG pictures to a single PDF file the command will be absolutely the same except you change the file extension of the graphic files e.g.:

# convert 1.PNG 2.PNG 3.PNG 4.PNG 5.PNG OUTPUT-PDF-FILE.PDF

I was quite happy eventually to know Linux is so flexible and such a trivial things are able to be completed in such an easy way.

Источник

Оцените статью