Forrest logo
back to the img2pdf tool

img2pdf:tldr:ff6f4

img2pdf: Auto orient the image, use a page size of A4 in landscape mode, and set a border of 2cm horizontally and 5.1cm vertically.
$ img2pdf ${filename-jpg} --auto-orient --pagesize ${A4^T} --border ${2cm}:${5-1cm} --output ${filename-pdf}
try on your machine

The given command is used to convert an image file (in .jpg format) to a PDF file. Let's break down each component of the command:

  1. img2pdf: This is the name of the program or the command-line tool being executed. It is the main command responsible for converting the image to a PDF.

  2. ${filename-jpg}: This is a placeholder for the name of the input JPG file. You need to replace it with the actual filename (e.g., image.jpg) before running the command.

  3. --auto-orient: This option automatically rotates the image based on its Exif orientation. It ensures that the image appears correctly oriented in the resulting PDF.

  4. --pagesize ${A4^T}: This option sets the page size of the PDF. ${A4^T} is a placeholder for an A4-sized page in portrait mode (T stands for "top").

  5. --border ${2cm}:${5-1cm}: This option sets the page borders of the PDF. ${2cm} defines a 2 cm border on all sides, and ${5-1cm} defines a 1 cm bottom border. The other sides will have a 2 cm border (as specified previously).

  6. --output ${filename-pdf}: This option specifies the output filename of the PDF file. ${filename-pdf} is a placeholder for the desired filename for the PDF output. You should substitute it with your preferred name (e.g., output.pdf) before executing the command.

To use this command, replace ${filename-jpg} with the name of the input JPG file, and replace ${filename-pdf} with the desired name for the output PDF file. Then, execute the command to convert the image to a PDF with the specified options.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the img2pdf tool