PDF to PDF API - HTTP

Overview

The Pdfcrowd API is HTTP-based, the communication is made through normal HTTP requests. You can call the API by sending an HTTP request to the API server address with options passed as POST data.

The POST request's content type must be multipart/form-data if the request includes any local files. Otherwise application/x-www-form-urlencoded can be used as well.

You can also check out our API client libraries if you want to implement the API in your favorite programming language.

Authentication

Authentication is needed in order to use the Pdfcrowd API. The credentials used for accessing the API are your Pdfcrowd username and the API key.
Sign up for a Free Trial

The authentication method for user credentials is HTTP Basic Access Authentication. You provide your credentials every time you make a request.

Server Address

The server address is https://api.pdfcrowd.com/convert//20.10/

Other addresses can be used:

  • https://api.pdfcrowd.com/convert/latest/ is for the latest converter version.
  • https://api.pdfcrowd.com/convert/20.10/ is for version 20.10.
  • https://api.pdfcrowd.com/convert/18.10/ is for version 18.10.
  • https://api.pdfcrowd.com/convert/ is a shortcut for version 18.10.

Both HTTP and HTTPS protocols are supported.

Examples

curl -f -u "demo:ce544b6ea52a5621fb9d55f8b542d14d" \
    -o "offer.pdf" \
    -F "input_format=pdf" \
    -F "f_1=@/path/to/cover.pdf" \
    -F "f_2=@/path/to/proposal.pdf" \
    -F "f_3=@/path/to/price.pdf" \
    -F "f_4=@/path/to/contact.pdf" \
    https://api.pdfcrowd.com/convert/20.10/
curl -f -u "demo:ce544b6ea52a5621fb9d55f8b542d14d" \
    -o "company_offer.pdf" \
    -F "input_format=pdf" \
    -F "page_watermark=@/path/to/watermark.pdf" \
    -F "f_1=@/path/to/proposal.pdf" \
    https://api.pdfcrowd.com/convert/20.10/
curl -f -u "demo:ce544b6ea52a5621fb9d55f8b542d14d" \
    -o "linearized.pdf" \
    -F "input_format=pdf" \
    -F "linearize=True" \
    -F "f_1=@/path/to/not_linearized.pdf" \
    https://api.pdfcrowd.com/convert/20.10/

Response Headers

HTTP response can contain the following headers.
You can find details about each conversion in your conversion log.

Name Description
X-Pdfcrowd-Debug-Log URL to the debug log
X-Pdfcrowd-Remaining-Credits the number of available conversion credits in your account
X-Pdfcrowd-Consumed-Credits the number of credits consumed by the conversion
X-Pdfcrowd-Job-Id the unique ID of the conversion
X-Pdfcrowd-Pages the total number of pages in the output document
X-Pdfcrowd-Output-Size the size of the output in bytes

Troubleshooting

  • Check API Status Codes in case of the error code is returned.
  • You can use debug_log to get detailed info about the conversion, such as conversion errors, time, console output.
  • Take a look at the FAQ section.

PDF to PDF API Reference

Conversion Format

input_format
The format of input file.
Allowed values:
  • pdf

PDF Manipulation

action
Specifies the action to be performed on the input PDFs.
Allowed values:
  • join
    Concatenate input PDFs into a single one.
  • shuffle
    Collate pages from input PDFs into a single one, take one page at a time from each input PDF. This is useful when combining two scanned documents containing odd and even pages.
Default: join

Response

output_name
The file name of the created file (max 180 chars). If not specified then the name is auto-generated.
content_disposition
The value of the Content-Disposition HTTP header sent in the response.
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.
Default: attachment

Watermark & Background

page_watermark
Apply the first page of the watermark PDF to every page of the output PDF.
Constraints:
  • The file must exist and not be empty.
page_watermark_url
Load a watermark PDF from the specified URL and apply the first page of the watermark PDF to every page of the output PDF.
Constraints:
  • The supported protocols are http:// and https://.
Example:
  • http://myserver.com/watermark.pdf
multipage_watermark
Apply each page of the specified watermark PDF to the corresponding page of the output PDF.
Constraints:
  • The file must exist and not be empty.
multipage_watermark_url
Load a watermark PDF from the specified URL and apply each page of the specified watermark PDF to the corresponding page of the output PDF.
Constraints:
  • The supported protocols are http:// and https://.
Example:
  • http://myserver.com/watermark.pdf
page_background
Apply the first page of the specified PDF to the background of every page of the output PDF.
Constraints:
  • The file must exist and not be empty.
page_background_url
Load a background PDF from the specified URL and apply the first page of the background PDF to every page of the output PDF.
Constraints:
  • The supported protocols are http:// and https://.
Example:
  • http://myserver.com/background.pdf
multipage_background
Apply each page of the specified PDF to the background of the corresponding page of the output PDF.
Constraints:
  • The file must exist and not be empty.
multipage_background_url
Load a background PDF from the specified URL and apply each page of the specified background PDF to the corresponding page of the output PDF.
Constraints:
  • The supported protocols are http:// and https://.
Example:
  • http://myserver.com/background.pdf

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.
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.
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

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.
Constraints:
  • Must be a positive integer number.
initial_zoom
Specify the initial page zoom in percents when the document is opened.
Constraints:
  • Must be a positive integer number.
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
right_to_left
Set the predominant reading order for text to right-to-left. This option has no direct effect on the document's contents or page numbering but can be used to determine the relative positioning of pages when displayed side by side or printed n-up
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 is returned in the X-Pdfcrowd-Debug-Log response header 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.