v1
latestOpenAPI 3.0.32026-07-131924190.9 KBConvert to PDF
Headers
Specifies the Chromium version that will be used for the conversion. Right now, only "116" and "142" are accepted. All new users are automatically using the latest version.
Request body
Will generates documents that doesn't count in the credits. The generated document will come with a watermark and you are limited to 10 documents per minutes.
Will return the generated PDF in Base64 encoded format, instead of raw.
Name of the destination file. Only an alphanumerical value with "-" or "_", of at least 7 chars accepted.
If given, the response will not be the PDF, but a JSON response containing an url parameter to an Amazon S3 bucket, to download the file. The file will be kept for 2 days, then automatically deleted.
See Saving the document to Amazon S3 for an example.
Path to your S3 bucket, in order to save the converted PDF directly into your AWS S3 account. Use a full path value like s3://doc-example-bucket/pdfshift/upload/86aa3ede7d05.pdf.
See Saving to your Amazon S3 for more details.
Note that you can also save to Google Cloud Storage and reach out to us if you want to store to other services as well
Use the print stylesheet instead of the general one.
Will append this CSS styles to the document before saving it. Can be an URL or a String of CSS rules.
Will execute the given Javascript before saving the document. Can be an URL or a String of JS code.
In milliseconds. Will wait for this duration before capturing the document. Up to 10 seconds max.
If provided, will kill the page loading at a specified time without stopping with a TimeoutError. Value in seconds.
Name of a function available globally. When present, PDFShift will wait for this function to return a truthy value (true, 1, a string, etc) or up to 30 seconds, then proceed to the conversion. If the function never returns a truthy value in the allocated time, the conversion will fail with an error.
If set to true, will wait that there was no network requests in the last 500ms.
Will not wait for long-polling request to end before generating the document. This can be helpful when loading a page that have websockets or long running queries that have no impact on the generated document. Requires wait_for_network to be set to true, otherwise the conversion never waits for network requests at all.
Will not execute the javascript at all in the document.
When set to true, will scroll the page to the bottom to trigger loading the images with lazy loading before saving the document.
Won't convert the document if the loaded source (when HTTP) returns a non 2XX response.
List of HTTP headers that you can pass to the request when loading the source URL.
When set to True, ensure the conversion's parameters are compliant to HIPAA regulations. This will disable features such as filename or webhook when the s3_destination is managed by PDFShift, to avoid storing any sensitive documents on PDFShift's servers. See Handling sensitive documents for more details.
When set to True, ensure the conversion's parameters are compliant to GDPR regulations. This will disable features such as filename or webhook when the s3_destination is managed by PDFShift, to avoid storing any sensitive documents on PDFShift's servers. See Handling sensitive documents for more details.
Log the request parameters. Useful for debugging purposes with PDFShift support.
Will set the view in landscape mode instead of portrait.
Format of the document. You can either use the standard values (Letter, Legal, Tabloid, Ledger, A0, A1, A2, A3, A4, A5) or a custom {width}x{height} value. For {width} and {height}, you can indicate the following units: in, cm, mm. . The {height} value can be replaced by auto to automatically adjust the height to the content. For instance, pasing the format 1024xauto will set the page width to 1024px and the height to the content height.
The final document will not have the background images.
Will analyze the last page of the document. If no content is present in it, the page will be removed. But note that if there are remaining hidden data, header or footer that have been pushed to that page, the page will be kept.
Pages to print. Can be one number (3), a range (1-5), a list (4,5,6) or a combination of both (1-3,6,7). If the number is higher than the real number of pages, that number will be ignored.
A value between 0.1 and 2. Allows you to increase the zoom in the document for specific purposes. 1 is the default zoom, lower is smaller, higher is bigger.
Allows you to add custom metadata to the generated PDF document. The following metadata are reserved and thus not accepted: 'author_raw', 'creator_raw', 'producer', 'producer_raw', 'subject_raw', 'title_raw'.
Example request
{
"metadata": {
"author": "John Doe",
"title": "Sample PDF Document",
"subject": "Demonstration of PDFShift Capabilities",
"keywords": "PDF, API, PDFShift, Example"
}
}Response
PDF file generated successfully