Image to PDF Command Line Reference

Conversion from an image to PDF.

usage: image2pdf [options] source
source
Source to be converted. It can be URL, path to a local file or '-' to use stdin as an input text.

Options

Image Operations

Settings used for operations with images.

-resize
Resize the image.
Default: 100%
Examples:
  • "200%"
  • "1024x768"
-rotate
Rotate the image.
Default: 0
-crop-area-x
Set the top left X coordinate of the content area. It is relative to the top left X coordinate of the print area.
Constraint:
  • The value must be specified in inches "in", millimeters "mm", centimeters "cm", pixels "px", or points "pt".
Default: 0px
Examples:
  • "-1in"
  • "2.5cm"
-crop-area-y
Set the top left Y coordinate of the content area. It is relative to the top left Y coordinate of the print area.
Constraint:
  • The value must be specified in inches "in", millimeters "mm", centimeters "cm", pixels "px", or points "pt".
Default: 0px
Examples:
  • "-1in"
  • "2.5cm"
-crop-area-width
Set the width of the content area. It should be at least 1 inch.
Constraint:
  • The value must be specified in inches "in", millimeters "mm", centimeters "cm", pixels "px", or points "pt".
Default: The width of the print area.
Examples:
  • "8in"
  • "25cm"
-crop-area-height
Set the height of the content area. It should be at least 1 inch.
Constraint:
  • The value must be specified in inches "in", millimeters "mm", centimeters "cm", pixels "px", or points "pt".
Default: The height of the print area.
Examples:
  • "8in"
  • "25cm"
-remove-borders
Remove borders of an image which does not change in color.
Allowed values:
  • true, 1 or on
  • false, 0 or off
Default: False

Page Setup

-page-size
Set the output page size.
Allowed values:
  • A0
  • A1
  • A2
  • A3
  • A4
  • A5
  • A6
  • Letter
-page-width
Set the output page width.
Constraint:
  • The value must be specified in inches "in", millimeters "mm", centimeters "cm", pixels "px", or points "pt".
Examples:
  • "300mm"
  • "9.5in"
-page-height
Set the output page height.
Constraint:
  • The value must be specified in inches "in", millimeters "mm", centimeters "cm", pixels "px", or points "pt".
Examples:
  • "15.25in"
  • "350mm"
-orientation
Set the output page orientation.
Allowed values:
  • landscape
  • portrait
Default: portrait
-position
Set the image position on the page.
Allowed values:
  • center
  • top
  • bottom
  • left
  • right
  • top-left
  • top-right
  • bottom-left
  • bottom-right
Default: center
Set the mode to print the image on the content area of the page.
Allowed values:
  • default
    No image scaling.
  • fit
    Fit image to page with aspect ratio.
  • stretch
    Stretch image to the page with no aspect ratio.
Default: default
-margin-top
Set the output page top margin.
Constraint:
  • The value must be specified in inches "in", millimeters "mm", centimeters "cm", pixels "px", or points "pt".
Examples:
  • "1in"
  • "2.5cm"
-margin-right
Set the output page right margin.
Constraint:
  • The value must be specified in inches "in", millimeters "mm", centimeters "cm", pixels "px", or points "pt".
Examples:
  • "1in"
  • "2.5cm"
-margin-bottom
Set the output page bottom margin.
Constraint:
  • The value must be specified in inches "in", millimeters "mm", centimeters "cm", pixels "px", or points "pt".
Examples:
  • "1in"
  • "2.5cm"
-margin-left
Set the output page left margin.
Constraint:
  • The value must be specified in inches "in", millimeters "mm", centimeters "cm", pixels "px", or points "pt".
Examples:
  • "1in"
  • "2.5cm"
-page-background-color
The page background color in RGB or RGBA hexadecimal format. The color fills the entire page regardless of the margins. If not page size is specified and the image format supports background (e.g. PDF, PNG), the background color is applied too.
Constraint:
  • The value must be in RRGGBB or RRGGBBAA hexadecimal format.
Examples:
  • red color
    "FF0000"
  • green color
    "00ff00"
  • green color with 50% opacity
    "00ff0080"
-dpi
Set the DPI resolution of the input image. The DPI affects margin options specified in points too (e.g. 1 point is equal to 1 pixel in 96 DPI).
Default: 96
Example:
  • The DPI used for printers. 1 inch contains 300 points.
    300

Watermark & Background

-page-watermark
Apply a watermark to each page of the output PDF file. A watermark can be either a PDF or an image. If a multi-page file (PDF or TIFF) is used, the first page is used as the watermark.
Constraint:
  • The file must exist and not be empty.
Examples:
  • "/home/user/john/watermark.pdf"
  • "/home/user/john/watermark.png"
-page-watermark-url
Load a file from the specified URL and apply the file as a watermark to each page of the output PDF. A watermark can be either a PDF or an image. If a multi-page file (PDF or TIFF) is used, the first page is used as the watermark.
Constraint:
  • The supported protocols are http:// and https://.
Examples:
  • "http://myserver.com/watermark.pdf"
  • "http://myserver.com/watermark.png"
-multipage-watermark
Apply each page of a watermark to the corresponding page of the output PDF. A watermark can be either a PDF or an image.
Constraint:
  • The file must exist and not be empty.
Examples:
  • "/home/user/john/watermark.pdf"
  • "/home/user/john/watermark.png"
-multipage-watermark-url
Load a file from the specified URL and apply each page of the file as a watermark to the corresponding page of the output PDF. A watermark can be either a PDF or an image.
Constraint:
  • The supported protocols are http:// and https://.
Examples:
  • "http://myserver.com/watermark.pdf"
  • "http://myserver.com/watermark.png"
-page-background
Apply a background to each page of the output PDF file. A background can be either a PDF or an image. If a multi-page file (PDF or TIFF) is used, the first page is used as the background.
Constraint:
  • The file must exist and not be empty.
Examples:
  • "/home/user/john/background.pdf"
  • "/home/user/john/background.png"
-page-background-url
Load a file from the specified URL and apply the file as a background to each page of the output PDF. A background can be either a PDF or an image. If a multi-page file (PDF or TIFF) is used, the first page is used as the background.
Constraint:
  • The supported protocols are http:// and https://.
Examples:
  • "http://myserver.com/background.pdf"
  • "http://myserver.com/background.png"
-multipage-background
Apply each page of a background to the corresponding page of the output PDF. A background can be either a PDF or an image.
Constraint:
  • The file must exist and not be empty.
Examples:
  • "/home/user/john/background.pdf"
  • "/home/user/john/background.png"
-multipage-background-url
Load a file from the specified URL and apply each page of the file as a background to the corresponding page of the output PDF. A background can be either a PDF or an image.
Constraint:
  • The supported protocols are http:// and https://.
Examples:
  • "http://myserver.com/background.pdf"
  • "http://myserver.com/background.png"

PDF Format

Miscellaneous values for PDF output.

-linearize
Create linearized PDF. This is also known as Fast Web View.
Allowed values:
  • true, 1 or on
  • false, 0 or off
Default: False
-encrypt
Encrypt the PDF. This prevents search engines from indexing the contents.
Allowed values:
  • true, 1 or on
  • false, 0 or off
Default: False
-user-password
Protect the PDF with a user password. When a PDF has a user password, it must be supplied in order to view the document and to perform operations allowed by the access permissions.
Example:
  • "123456"
-owner-password
Protect the PDF with an owner password. Supplying an owner password grants unlimited access to the PDF including changing the passwords and access permissions.
Example:
  • "123456"
-no-print
Disallow printing of the output PDF.
Allowed values:
  • true, 1 or on
  • false, 0 or off
Default: False
-no-modify
Disallow modification of the output PDF.
Allowed values:
  • true, 1 or on
  • false, 0 or off
Default: False
-no-copy
Disallow text and graphics extraction from the output PDF.
Allowed values:
  • true, 1 or on
  • false, 0 or off
Default: False
-title
Set the title of the PDF.
Example:
  • "My Resume"
-subject
Set the subject of the PDF.
Example:
  • "CV - Software Developer"
-author
Set the author of the PDF.
Example:
  • "John Doe"
-keywords
Associate keywords with the document.
Example:
  • "software developer, Unix, databases"

Viewer Preferences

These preferences specify how a PDF viewer should present the document. The preferences may be ignored by some PDF viewers.

-page-layout
Specify the page layout to be used when the document is opened.
Allowed values:
  • single-page
    Display one page at a time.
  • one-column
    Display the pages in one column.
  • two-column-left
    Display the pages in two columns, with odd-numbered pages on the left.
  • two-column-right
    Display the pages in two columns, with odd-numbered pages on the right.
-page-mode
Specify how the document should be displayed when opened.
Allowed values:
  • full-screen
    Full-screen mode.
  • thumbnails
    Thumbnail images are visible.
  • outlines
    Document outline is visible.
-initial-zoom-type
Specify how the page should be displayed when opened.
Allowed values:
  • fit-width
    The page content is magnified just enough to fit the entire width of the page within the window.
  • fit-height
    The page content is magnified just enough to fit the entire height of the page within the window.
  • fit-page
    The page content is magnified just enough to fit the entire page within the window both horizontally and vertically. If the required horizontal and vertical magnification factors are different, use the smaller of the two, centering the page within the window in the other dimension.
-initial-page
Display the specified page when the document is opened.
Constraint:
  • Must be a positive integer number.
Example:
  • 2
-initial-zoom
Specify the initial page zoom in percents when the document is opened.
Constraint:
  • Must be a positive integer number.
Example:
  • 50
-hide-toolbar
Specify whether to hide the viewer application's tool bars when the document is active.
Allowed values:
  • true, 1 or on
  • false, 0 or off
Default: False
-hide-menubar
Specify whether to hide the viewer application's menu bar when the document is active.
Allowed values:
  • true, 1 or on
  • false, 0 or off
Default: False
-hide-window-ui
Specify whether to hide user interface elements in the document's window (such as scroll bars and navigation controls), leaving only the document's contents displayed.
Allowed values:
  • true, 1 or on
  • false, 0 or off
Default: False
-fit-window
Specify whether to resize the document's window to fit the size of the first displayed page.
Allowed values:
  • true, 1 or on
  • false, 0 or off
Default: False
-center-window
Specify whether to position the document's window in the center of the screen.
Allowed values:
  • true, 1 or on
  • false, 0 or off
Default: False
-display-title
Specify whether the window's title bar should display the document title. If false , the title bar should instead display the name of the PDF file containing the document.
Allowed values:
  • true, 1 or on
  • false, 0 or off
Default: False

Miscellaneous

-debug-log
Turn on the debug logging. Details about the conversion are stored in the debug log. The URL of the log can be obtained from the getDebugLogUrl method or available in conversion statistics.
Allowed values:
  • true, 1 or on
  • false, 0 or off
Default: False
-tag
Tag the conversion with a custom value. The tag is used in conversion statistics. A value longer than 32 characters is cut off.
Example:
  • "client-1234"
-http-proxy
A proxy server used by Pdfcrowd conversion process for accessing the source URLs with HTTP scheme. It can help to circumvent regional restrictions or provide limited access to your intranet.
Constraint:
  • The value must have format DOMAIN_OR_IP_ADDRESS:PORT.
Examples:
  • "myproxy.com:8080"
  • "113.25.84.10:33333"
-https-proxy
A proxy server used by Pdfcrowd conversion process for accessing the source URLs with HTTPS scheme. It can help to circumvent regional restrictions or provide limited access to your intranet.
Constraint:
  • The value must have format DOMAIN_OR_IP_ADDRESS:PORT.
Examples:
  • "myproxy.com:443"
  • "113.25.84.10:44333"