PDF to PDF API - CLI

Join multiple PDF files from the command line using the Pdfcrowd API v2.

Installation

Install the application from PyPI
pip install pdfcrowd

Learn more about other install options.

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

Examples

pdf2pdf -user-name "demo" -api-key "ce544b6ea52a5621fb9d55f8b542d14d" \
    /path/to/cover.pdf \
    /path/to/proposal.pdf \
    /path/to/price.pdf \
    /path/to/contact.pdf > "offer.pdf"
pdf2pdf -user-name "demo" -api-key "ce544b6ea52a5621fb9d55f8b542d14d" \
    -page-watermark "/path/to/watermark.pdf" \
    /path/to/proposal.pdf > "company_offer.pdf"
pdf2pdf -user-name "demo" -api-key "ce544b6ea52a5621fb9d55f8b542d14d" \
    -linearize \
    /path/to/not_linearized.pdf > "linearized.pdf"

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.

pdf2pdf Manual

Conversion from PDF to PDF.

usage: pdf2pdf [options] source

Conversion from PDF to PDF.

positional arguments:
  source                Input files used for a conversion.

optional arguments:
  -user-name USER_NAME  Your user name at pdfcrowd.com.
  -api-key API_KEY      Your API key at pdfcrowd.com.
  -action ACTION        Specifies the action to be performed on the input
                        PDFs. Allowed values are join, shuffle. Default is
                        join.
  -page-watermark PAGE_WATERMARK
                        Apply the first page of the watermark PDF to every
                        page of the output PDF. The file path to a local
                        watermark PDF file. The file must exist and not be
                        empty.
  -page-watermark-url 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. The supported protocols are http://
                        and https://.
  -multipage-watermark MULTIPAGE_WATERMARK
                        Apply each page of the specified watermark PDF to the
                        corresponding page of the output PDF. The file path to
                        a local watermark PDF file. The file must exist and
                        not be empty.
  -multipage-watermark-url 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. The supported
                        protocols are http:// and https://.
  -page-background PAGE_BACKGROUND
                        Apply the first page of the specified PDF to the
                        background of every page of the output PDF. The file
                        path to a local background PDF file. The file must
                        exist and not be empty.
  -page-background-url 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. The supported protocols are http://
                        and https://.
  -multipage-background MULTIPAGE_BACKGROUND
                        Apply each page of the specified PDF to the background
                        of the corresponding page of the output PDF. The file
                        path to a local background PDF file. The file must
                        exist and not be empty.
  -multipage-background-url 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. The supported
                        protocols are http:// and https://.
  -linearize            Create linearized PDF. This is also known as Fast Web
                        View.
  -encrypt              Encrypt the PDF. This prevents search engines from
                        indexing the contents.
  -user-password 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. The user password.
  -owner-password 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. The owner password.
  -no-print             Disallow printing of the output PDF.
  -no-modify            Disallow modification of the output PDF.
  -no-copy              Disallow text and graphics extraction from the output
                        PDF.
  -page-layout PAGE_LAYOUT
                        Specify the page layout to be used when the document
                        is opened. Allowed values are single-page, one-column,
                        two-column-left, two-column-right.
  -page-mode PAGE_MODE  Specify how the document should be displayed when
                        opened. Allowed values are full-screen, thumbnails,
                        outlines.
  -initial-zoom-type INITIAL_ZOOM_TYPE
                        Specify how the page should be displayed when opened.
                        Allowed values are fit-width, fit-height, fit-page.
  -initial-page INITIAL_PAGE
                        Display the specified page when the document is
                        opened. Must be a positive integer number.
  -initial-zoom INITIAL_ZOOM
                        Specify the initial page zoom in percents when the
                        document is opened. Must be a positive integer number.
  -hide-toolbar         Specify whether to hide the viewer application's tool
                        bars when the document is active.
  -hide-menubar         Specify whether to hide the viewer application's menu
                        bar when the document is active.
  -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.
  -fit-window           Specify whether to resize the document's window to fit
                        the size of the first displayed page.
  -center-window        Specify whether to position the document's window in
                        the center of the screen.
  -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.
  -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
  -debug-log            Turn on the debug logging. Details about the
                        conversion are stored in the debug log.
  -tag TAG              Tag the conversion with a custom value. The tag is
                        used in conversion statistics. A value longer than 32
                        characters is cut off. A string with the custom tag.
  -converter-version CONVERTER_VERSION
                        Set the converter version. Different versions may
                        produce different output. Choose which one provides
                        the best output for your case. The version identifier.
                        Allowed values are latest, 20.10, 18.10. Default is
                        20.10.
  -use-http             Specifies if the client communicates over HTTP or
                        HTTPS with Pdfcrowd API. Warning: Using HTTP is
                        insecure as data sent over HTTP is not encrypted.
                        Enable this option only if you know what you are
                        doing.
  -user-agent USER_AGENT
                        Set a custom user agent HTTP header. It can be useful
                        if you are behind some proxy or firewall. The user
                        agent string.
  -proxy PROXY          Specifies an HTTP proxy that the API client library
                        will use to connect to the internet. PROXY must
                        contain 4 values separated by a semicolon. The proxy
                        hostname. The proxy port. The username. The password.
  -retry-count RETRY_COUNT
                        Specifies the number of retries when the 502 HTTP
                        status code is received. The 502 status code indicates
                        a temporary network issue. This feature can be
                        disabled by setting to 0. Number of retries wanted.
                        Default is 1.

produced by: www.pdfcrowd.com