Developer Docs

Web Integrations

API Docs

Web Integrations

Integrate your website with our PDF tools

Open your files with our web tools

Here are some use-cases:

  1. Allow clients to easily fill out your PDF form, using our editor.
  2. Allow clients to sign a PDF doc and send it back to you by email.
  3. Provide a simple way for your clients to crop your PDF templates.

How it Works

Copy code Click to try

Copy the above integration link and use it in your website or emails.
Need help setting it up? Please contact support.

Developer Setup

Input files

Input files can be passed as a GET parameter, in JSON format.

https://www.sejda.com/pdf-editor?files=[{"downloadUrl":"https://www.example.com/download/sample.pdf"}]

You'll need to URL encode the JSON value. Above code displays unencoded JSON for readability.

https://www.sejda.com/pdf-editor?files=%5B%7B%22downloadUrl%22%3A%22https%3A%2F%2Fwww.example.com%2Fdownload%2Fsample.pdf%22%7D%5D

An array of multiple files is accepted for certain tools (eg: merge, compress).

Return by email

To receive the edited documents back by email add a returnEmail parameter to the URL:

https://www.sejda.com/pdf-editor?files=[{"downloadUrl":"https://www.example.com/download/sample.pdf"}]&returnEmail=your@email.address

Remember to URL encode the email address value passed in:

&returnEmail=your%40email.address

'Save to PDF' link for your web page

Let your visitors save pages from your website to PDF. Convert URLs to PDF.

How it works

The URL is optional, can be automatically detected and works on any page without configuration.

<a href="https://www.sejda.com/html-to-pdf?save-link">Save to PDF</a>

More Options

https://www.sejda.com/html-to-pdf?save-link=https://fs.blog&viewportWidth=1440&pageSize=A3&pageOrientation=landscape&pageMargin=100px
List of All Options
Name Description
save-link Web page URL to convert to PDF. Eg: https://fs.blog. Defaults to the referring page.
pageSize One of the standard page sizes: a0, a1, a2, a3, a4, a5, letter, legal. Defaults to one long page.
viewportWidth The width, in pixels, for the rendered HTML page. Eg: 1440. Defaults to browser's window.innerWidth
pageOrientation One of portrait, landscape or auto (default). Eg: auto
pageMargin Size of page margin, including units (px, in, cm or mm). Eg: 100px. Defaults to no margin.


API Docs

Hosted API, running on our servers (api.sejda.com)
Currently in BETA.

Pricing

Free to use within the free tier limits.
Paid API plans will be announced when going out of BETA.

Limits

Current limit is 30 requests per minute.
Need more? Please get in touch.

Authentication

No account or api key required to get started with the free tier.

HTML to PDF

Convert HTML to PDF documents.

Get started

Run this CURL command in your console:

$> curl -i https://api.sejda.com/v1/tasks\
  --fail --silent --show-error \
  --header "Content-Type: application/json" \
  --data '{"url": "https://csszengarden.com",
           "type": "htmlToPdf" }' > csszengarden_com.pdf

Endpoint URL

The API is organized around REST.

https://api.sejda.com/v1/tasks

Request

Make a POST request with JSON body:

Content-Type: application/json

Examples:

{"type":"htmlToPdf","url":"csszengarden.com"}

Converting HTML code (instead of an URL) to PDF:

{"type":"htmlToPdf","htmlCode":"<strong>HTML<\/strong> rules"}

HTML to PDF Options

Name Type Default Description
url string optional Web page URL to convert to PDF. Eg: https://csszengarden.com
htmlCode string optional HTML source code to convert to PDF. Eg: <strong>HTML</strong> rules
pageSize string one_long_page one_long_page or one of the standard page sizes: a0, a1, a2, a3, a4, a5, letter, legal.
pageOrientation string auto landscape, portrait or auto.
viewportWidth integer optional The width in pixels for the rendered HTML page. Eg: 1600
pageMargin double optional Specifies the size of the margin around the PDF page. To be used together with pageMarginUnits. Eg: 2.2
pageMarginUnits string optional Specifies the units to be used for the margin size. One of px, in, cm or mm. To be used together with pageMargin. Eg: px for a margin size specified in pixels.
hideNotices boolean false Attempt to automatically hide cookie notices and similar overlays. Eg: true

HTTP Response Codes

200 All OK. Response contents will be the PDF document stream.
429 Rate limit reached.
400 Invalid request.
500 An error on our side.

Other PDF tools?

API access for other PDF tools (crop, merge, compress, etc) is not yet available.