Image to PDF / HTTP API Reference

Conversion Input

url

The address of the image to convert.

Constraint:
  • Supported protocols are http:// and https://.

file

The path to a local file to convert.

Constraint:
  • The file must exist and not be empty.

data

Convert raw binary data to the desired output format.

Use this for processing binary content, handling file uploads as byte arrays, or when working with data from external APIs. Provides maximum flexibility for binary data conversions.

Conversion Format

input_format

The format of the input file. Specify the source format to ensure correct processing (HTML, PDF, image, etc.).

Allowed Values:
  • image — Image format is recognized automatically.

Response

output_name

The file name of the created file (max 180 chars). If not specified, the name is auto-generated.

content_disposition

The value of the Content-Disposition HTTP header sent in the response.

Default:
attachment
Allowed Values:
  • attachment — Forces the browser to pop up a Save As dialog.
  • inline — The browser will open the result file in the browser window.

Image Operations

Settings used for operations with images.

resize

Scale the image to different dimensions. Accepts percentage values for proportional scaling or explicit pixel dimensions for absolute sizing.

Default:
100%
Examples:
  • Enlarge for high-res display: 200%
  • Standard XGA screen resolution: 1024x768

rotate

Rotate the image by the specified angle in degrees. Positive values rotate clockwise, negative values counterclockwise.

crop_area_x

Set the horizontal starting position of the crop area, measured from the left edge of the print area. Positive values offset inward from the left edge, negative values extend beyond the left boundary.

Constraint:
  • The value must be specified in inches 'in', millimeters 'mm', centimeters 'cm', pixels 'px', or points 'pt'.
Default:
0px
Examples:
  • Crop extends beyond left edge: -1in
  • Skip narrow border area: 10mm

crop_area_y

Set the vertical starting position of the crop area, measured from the top edge of the print area. Positive values offset inward from the top edge, negative values extend beyond the top boundary.

Constraint:
  • The value must be specified in inches 'in', millimeters 'mm', centimeters 'cm', pixels 'px', or points 'pt'.
Default:
0px
Examples:
  • Crop extends beyond top edge: -1in
  • Skip narrow border area: 10mm

crop_area_width

Set the horizontal extent of the crop area. Defines the width of the region to be converted. Minimum value is 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:
  • Standard document crop width: 8in
  • Full A4 page width crop: 210mm

crop_area_height

Set the vertical extent of the crop area. Defines the height of the region to be converted. Minimum value is 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:
  • Standard US Letter crop height: 11in
  • Full A4 page height crop: 297mm

remove_borders

Detect and remove solid-color borders surrounding the image content. Only removes borders that consist of a single consistent color.

Default:
false
Allowed Values:
  • true, 1 or on
  • false, 0 or off

Page Setup

page_size

Set the output page size. Use standard sizes (A4, Letter, A3, etc.) for printable output with consistent dimensions.

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:
  • A4 landscape / A3 portrait width: 297mm
  • US Letter/Legal standard width: 8.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:
  • A3 standard height for posters: 420mm
  • US Letter standard height: 11in

orientation

Set the output page orientation. Use portrait for standard documents, landscape for wide content like tables.

Default:
portrait
Allowed Values:
  • landscape
  • portrait

position

Set the image position on the page. Center for balanced layout, or corner/edge positions for specific design needs.

Default:
center
Allowed Values:
  • center
  • top
  • bottom
  • left
  • right
  • top-left
  • top-right
  • bottom-left
  • bottom-right

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:
  • Wide margin for framing: 1in
  • Narrow professional margin: 10mm

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:
  • Wide margin for framing: 1in
  • Narrow professional margin: 10mm

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:
  • Wide margin for framing: 1in
  • Narrow professional margin: 10mm

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:
  • Wide margin for framing: 1in
  • Narrow professional margin: 10mm

page_background_color

The page background color in RGB or RGBA hexadecimal format. The color fills the entire page regardless of the margins. If no 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 the first page of a watermark PDF to every page of the output PDF. Use this to add transparent overlays like "DRAFT" stamps, security markings, or branding elements that appear on top of content. Ideal for confidential document marking or adding protective overlays.

Constraint:
  • The file must exist and not be empty.
Examples:
  • Multi-page PDF for watermarking: /home/user/john/watermark.pdf
  • Transparent PNG overlay: /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:
  • Supported protocols are http:// and https://.
Examples:
  • Download watermark from server: http://myserver.com/watermark.pdf
  • Remote logo watermark: http://myserver.com/watermark.png

multipage_watermark

Apply each page of a watermark PDF to the corresponding page of the output PDF. Use this for page-specific watermarks where different pages need different overlays - for example, different approval stamps per department.

If the watermark has fewer pages than the output, the last watermark page is repeated for remaining pages.

Constraint:
  • The file must exist and not be empty.
Examples:
  • Multi-page PDF for watermarking: /home/user/john/watermark.pdf
  • Transparent PNG overlay: /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:
  • Supported protocols are http:// and https://.
Examples:
  • Download watermark from server: http://myserver.com/watermark.pdf
  • Remote logo watermark: http://myserver.com/watermark.png

page_background

Apply the first page of a background PDF to every page of the output PDF. Use this to add letterheads, branded templates, or decorative backgrounds that appear behind your content. Backgrounds appear beneath content, while watermarks layer on top.

Perfect for adding company letterheads to reports or applying branded templates to dynamically generated content.

Constraint:
  • The file must exist and not be empty.
Examples:
  • PDF template background: /home/user/john/background.pdf
  • Image texture background: /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:
  • Supported protocols are http:// and https://.
Examples:
  • Download template background: http://myserver.com/background.pdf
  • Remote background pattern: http://myserver.com/background.png

multipage_background

Apply each page of a background PDF to the corresponding page of the output PDF. Use this for page-specific backgrounds where each page needs a different template - for example, different letterheads for front and back pages.

If the background has fewer pages than the output, the last background page is repeated for remaining pages.

Constraint:
  • The file must exist and not be empty.
Examples:
  • PDF template background: /home/user/john/background.pdf
  • Image texture background: /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:
  • Supported protocols are http:// and https://.
Examples:
  • Download template background: http://myserver.com/background.pdf
  • Remote background pattern: http://myserver.com/background.png

PDF Format

Miscellaneous values for PDF output.

linearize

Create linearized PDF. This is also known as Fast Web View. Use this to optimize PDFs for progressive download, allowing users to start viewing the first page while the rest downloads.

Default:
false
Allowed Values:
  • true, 1 or on
  • false, 0 or off

encrypt

Encrypt the PDF to prevent search engines from indexing the contents and add an extra layer of security. Use this for confidential documents, internal reports, or any content you do not want appearing in search results.

Combine with a password to require authentication for viewing, or just use encryption alone to prevent indexing while keeping the PDF publicly readable.

Default:
false
Allowed Values:
  • true, 1 or on
  • false, 0 or off

user_password

Protect the PDF with a user password to restrict who can open and view the document. Recipients must enter this password to view the PDF. Use this for confidential documents, sensitive data, or content distribution where you want to control access.

Combine with permission flags to restrict what users can do after opening.

Example:
  • Simple document password: 123456

owner_password

Protect the PDF with an owner password for administrative control. This password allows changing permissions, passwords, and document restrictions - like a master key. Use different user and owner passwords to give recipients restricted access while retaining full control.

The owner password should be kept confidential and different from the user password.

Example:
  • Admin access password: 123456

no_print

Disallow printing of the output PDF to protect sensitive content. Use this for confidential documents, copyrighted materials, or preview versions you want to restrict.

Default:
false
Allowed Values:
  • true, 1 or on
  • false, 0 or off

no_modify

Disallow modification of the output PDF to maintain document integrity. Use this for official documents, contracts, or records that should not be altered after creation. Prevents recipients from editing content, adding annotations, or extracting pages.

Default:
false
Allowed Values:
  • true, 1 or on
  • false, 0 or off

no_copy

Disallow text and graphics extraction from the output PDF to protect copyrighted content. Use this for ebooks, proprietary documents, or materials where you want to prevent easy copying and redistribution.

Default:
false
Allowed Values:
  • true, 1 or on
  • false, 0 or off

title

Set the title of the PDF that appears in PDF reader title bars and document properties. Use descriptive titles for better organization and searchability in document management systems.

This metadata helps users identify documents when multiple PDFs are open and improves accessibility for screen readers.

Example:
  • Personal CV title: My Resume

subject

Set the subject of the PDF to categorize or summarize the document content. Use this to add searchable metadata for document management systems, improve organization in large PDF libraries, or provide context about the document's purpose.

Appears in PDF properties dialog.

Example:
  • Technical position subject: CV - Software Developer

author

Set the author of the PDF for attribution and document tracking. Use this to identify who created the document, important for official documents, reports, or publications.

This metadata appears in PDF properties and helps with document management and version control.

Example:
  • Document author name: John Doe

keywords

Associate keywords with the document to improve searchability in document management systems. Use relevant terms that describe the content, making it easier to find documents later.

Separate multiple keywords with commas. Particularly useful for large document repositories or DAM systems.

Example:
  • Technical skills for searchability: 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

Control how pages appear when the PDF opens in viewers that respect these preferences. "single-page" for focused reading one page at a time. "one-column" for continuous scrolling like a web page. "two-column-left" for book-like layouts with odd pages on left (international standard). "two-column-right" for magazines with odd pages on right.

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

Control the initial display mode when the PDF opens. "full-screen" for presentations and kiosk displays where you want an immersive experience. "thumbnails" for long documents where visual page navigation is helpful. "outlines" for structured documents with bookmarks/table of contents.

Allowed Values:
  • full-screen — Full-screen mode.
  • thumbnails — Thumbnail images are visible.
  • outlines — Document outline is visible.

initial_zoom_type

Control how the PDF is initially zoomed 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.
Example:
  • Start at second page: 2

initial_zoom

Specify the initial page zoom in percents when the document is opened.

Constraint:
  • Must be a positive integer.
Example:
  • Half-size zoom level: 50

hide_toolbar

Hide the viewer's toolbar when the PDF is opened to provide a cleaner, more focused reading experience. Use this for presentations, kiosk displays, or immersive reading where you want minimal UI distractions.

Default:
false
Allowed Values:
  • true, 1 or on
  • false, 0 or off

hide_menubar

Hide the viewer's menu bar when the PDF is opened for a cleaner interface. Use this for kiosk mode, presentations, or embedded PDFs where you want to minimize UI elements.

Default:
false
Allowed Values:
  • true, 1 or on
  • false, 0 or off

hide_window_ui

Hide user interface elements like scroll bars and navigation controls when the PDF opens. Use this for presentation mode, digital signage, or embedded PDFs where you want the most minimal interface possible.

Combines with other UI hiding options for full-screen immersive viewing.

Default:
false
Allowed Values:
  • true, 1 or on
  • false, 0 or off

fit_window

Resize the PDF viewer window to fit the size of the first displayed page when opened. Use this to ensure the PDF opens at an appropriate size rather than filling the entire screen.

Particularly useful for small documents, forms, or certificates that look better at actual size.

Default:
false
Allowed Values:
  • true, 1 or on
  • false, 0 or off

center_window

Position the PDF viewer window in the center of the screen when opened. Use this with window resizing to create a professional, centered display for forms, certificates, or small documents.

Improves the initial viewing experience by avoiding corner-positioned windows.

Default:
false
Allowed Values:
  • true, 1 or on
  • false, 0 or off

display_title

Display the title of the HTML document in the PDF viewer's title bar instead of the filename. Use this to show more descriptive titles when PDFs are opened - particularly useful when the filename is cryptic or auto-generated.

Improves user experience by showing meaningful document names.

Default:
false
Allowed Values:
  • true, 1 or on
  • false, 0 or off

Miscellaneous

debug_log

Turn on debug logging to troubleshoot conversion issues. Details about the conversion process, including resource loading, rendering steps, and error messages are stored in the debug log. Use this when conversions fail or produce unexpected results. The URL of the log is returned in the x-pdfcrowd-debug-log response header or available in conversion statistics.

Default:
false
Allowed Values:
  • true, 1 or on
  • false, 0 or off

tag

Tag the conversion with a custom value for tracking and analytics. Use this to categorize conversions by customer ID, document type, or business unit. The tag appears in conversion statistics. A value longer than 32 characters is cut off.

Example:
  • Track job in analytics: client-1234

http_proxy

A proxy server used by the conversion process for accessing the source URLs with HTTP scheme. This can help circumvent regional restrictions or provide limited access to your intranet.

Constraint:
  • The value must have format DOMAIN_OR_IP_ADDRESS:PORT.
Examples:
  • Corporate proxy server: myproxy.com:8080
  • Direct IP proxy connection: 113.25.84.10:33333

https_proxy

A proxy server used by the conversion process for accessing the source URLs with HTTPS scheme. This can help circumvent regional restrictions or provide limited access to your intranet.

Constraint:
  • The value must have format DOMAIN_OR_IP_ADDRESS:PORT.
Examples:
  • Secure proxy for HTTPS: myproxy.com:443
  • Direct secure proxy IP: 113.25.84.10:44333