Developer Docs
Web Integrations
API reference
Web Integrations
Integrate your website with our PDF tools
Open your files with our web tools
Open files from your website using our web tools (eg: the PDF editor).
Here are some use-cases:
- Allow clients to easily fill out your PDF form, using our editor.
- Allow clients to sign a PDF doc and send it back to you by email.
- Provide a simple way for your clients to crop your PDF templates.
Configure demo
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"}]
Above code displays unencoded JSON for readability. You'll need to URL encode the JSON value:
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 returnUrl
parameter to the URL:
https://www.sejda.com/pdf-editor?files=[{"downloadUrl":"https://www.example.com/download/sample.pdf"}]&returnUrl=your@email.address
Remember to URL encode the email address value passed in:
&returnUrl=your%40email.address
Return to your website (webhook)
The user can return to your website after finishing editing, together with the edited document data.
This integration method is currently in closed Beta. Please contact support to learn more.
'Save to PDF' link for your web page
Let your visitors save web pages to PDF.
Demo
Copy and paste the HTML code below and add it to your web page:
Setup
No setup is required.
The web page URL to be converted is determined from the HTTP Referrer.
Want to configure the URL of the page being converted?
https://www.sejda.com/html-to-pdf?save-link=https://example.com
Want a specific page size?
https://www.sejda.com/html-to-pdf?save-link=https://example.com&pageSize=A3
Want a specific viewport width?
https://www.sejda.com/html-to-pdf?save-link=https://example.com&viewportWidth=1440
Name | Description | |
save-link | Web page URL to convert to PDF. Defaults to referring page the user is coming from (HTTP referrer). | |
pageSize | One of the standard page sizes: a0 , a1 , a2 , a3 , a4 , a5 , letter , legal or leave empty for one long page (default). |
|
viewportWidth | The width, in pixels, for the rendered HTML page. Eg: 1440 |
|
pageOrientation | One of portrait , landscape or auto (default). Eg: auto |
API reference
Access Sejda.com tools from your code
Hosted API, running on our sejda.com servers.
Currently in BETA. This API is not production ready yet.
Endpoint URL
The Sejda.com API is organized around REST. We recommend using SSL encryption by issuing requests through HTTPS, however it’s not enforced.
https://api.sejda.com/v1/tasks
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 web pages 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": "csszengarden.com", "type": "htmlToPdf" }' > csszengarden_com.pdf
Request headers
Content-Type: application/json
Body format
JSON format. Examples:
Example: convert URL to PDF:
{"type":"htmlToPdf","url":"csszengarden.com"}
Example: convert HTML code to PDF:
{"type":"htmlToPdf","htmlCode":"<strong>HTML<\/strong> rules"}
Parameters:
Name | Type | Default | Description | |
url | string | optional | Web page URL to convert to PDF. | Eg: "http://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 |
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 coming soon.