pdflayer

FREE
By apilayer
Updated 9 months ago
Tools
4.2/10
Popularity Score
324ms
Latency
100%
Success Rate

pdflayer API Documentation

Supercharge High Quality PDF Conversion in any Application. Powerful URL & HTML to PDF conversion for documents of any size, using any programming language, lightning-fast and tailored for any use case.

View API Details
GET/convert
GET/convert

Main API endpoint for PDF conversion

Authorization:

Access the pdflayer API by appending your unique Access Key.

Header Parameters
X-RapidAPI-HostSTRING
REQUIRED
X-RapidAPI-KeySTRING
REQUIRED
Required Parameters
document_urlSTRING
REQUIREDThe URL of the HTML source you would like to convert to PDF. Looking to use pass raw HTML code to the API? Learn more at https://pdflayer.com/documentation#quickstart
access_keyQUERY
REQUIREDdescription
Optional Parameters
document_nameSTRING
OPTIONALspecify a PDF name of up to 180 characters.
custom_unitSTRING
OPTIONALset to px (Pixels), pt (Points), in (Inches) or mm (Millimeters)
user_agentSTRING
OPTIONALset to your preferred User-Agent header string
accept_langSTRING
OPTIONALset to your preferred Accept-Language header string
text_encodingSTRING
OPTIONALset to your preferred text encoding string
ttlNUMBER
OPTIONALthe time (in seconds) a generated PDF is cached
forceNUMBER
OPTIONALset to 1 to force new PDF
inlineNUMBER
OPTIONALset to 1 to display PDF document inline
auth_userSTRING
OPTIONALspecify username used to access password-protected site
auth_passSTRING
OPTIONALspecify password used to access password-protected site
encryptionNUMBER
OPTIONALset to 40 (40-bit) or 128 (128-bit)
owner_passwordSTRING
OPTIONALspecify owner password to password protect PDF
user_passwordSTRING
OPTIONALspecify user password to password protect PDF
no_imagesNUMBER
OPTIONALSet to 1 in order to disable images
no_hyperlinksNUMBER
OPTIONALSet to 1 in order to disable hyperlinks
no_backgroundsNUMBER
OPTIONALSet to 1 in order to disable CSS backgrounds
no_javascriptNUMBER
OPTIONALSet to 1 in order to disable JavaScript
use_print_mediaNUMBER
OPTIONALSet to 1 in order to activate CSS @media print declarations
grayscaleNUMBER
OPTIONALSet to 1 in order to remove all colours
low_qualityNUMBER
OPTIONALSet to 1 in order to generate low quality PDF
formsNUMBER
OPTIONALSet to 1 in order to enable forms on your PDF
no_printNUMBER
OPTIONALSet to 1 in order to disable printing of the final PDF document. Requires encryption, owner_password or user_password to be specified
no_modifyNUMBER
OPTIONALSet to 1 in order to disable modification of the final PDF document. Requires encryption, owner_password or user_password to be specified
no_copyNUMBER
OPTIONALSet to 1 in order to disable the possibility to copy any text of the final PDF document. Requires encryption, owner_password or user_password to be specified
page_sizeSTRING
OPTIONALset to preferred page size, e.g. A4, A5, etc.
page_widthNUMBER
OPTIONALspecify page width (numeric), e.g. 200 (overrides page_size)
page_heightNUMBER
OPTIONALspecify page height (numeric), e.g. 600 (overrides page_size)
orientationSTRING
OPTIONALset to portrait or landscape
margin_topNUMBER
OPTIONALset to preferred top margin value (numeric), e.g. 5
margin_bottomNUMBER
OPTIONALset to preferred bottom margin value (numeric), e.g. 5
margin_leftNUMBER
OPTIONALset to preferred left margin value (numeric), e.g. 5
margin_rightNUMBER
OPTIONALset to preferred right margin value (numeric), e.g. 5
header_spacingNUMBER
OPTIONALset to preferred header spacing value (numeric), e.g. 10
header_textNUMBER
OPTIONALset to preferred header text, e.g. "This is my heading"
header_alignSTRING
OPTIONALset to left, center or right
header_urlSTRING
OPTIONALset to (urlencoded) URL containing your preferred header HTML elements. Want to use raw HTML code? Learn more at https://pdflayer.com/documentation#pdf_header
footer_spacingSTRING
OPTIONALset to preferred footer spacing value (numeric), e.g. 10
footer_textSTRING
OPTIONALset to preferred footer text, e.g. "This is my footer"
footer_alignSTRING
OPTIONALset to left, center or right
footer_urlSTRING
OPTIONALset to (urlencoded) URL containing your preferred footer HTML elements. Want to use raw HTML code? Learn more at https://pdflayer.com/documentation#pdf_footer
viewportSTRING
OPTIONALSet to preferred viewport "width x height", e.g. 320x480
css_urlSTRING
OPTIONALinject a custom CSS stylesheet using a (urlencoded) URL
delaySTRING
OPTIONALspecify a delay (in seconds) before PDF is captured
dpiNUMBER
OPTIONALspecify the DPI resolution (numerical) between 10 and 10000
zoomNUMBER
OPTIONALspecify page zoom factor between 0 and 50
watermark_urlSTRING
OPTIONALspecify a watermark URL (urlencoded) containing a PNG or JPG image
watermark_offset_xNUMBER
OPTIONALspecify a horizontal watermark offset, e.g. 10
watermark_offset_yNUMBER
OPTIONALspecify a vertical watermark offset, e.g. 10
watermark_opacityNUMBER
OPTIONALspecify watermark opacity percentage (numeric) between 0 and 100
watermark_in_backgroundNUMBER
OPTIONALset to 1 to place watermark behind text
titleSTRING
OPTIONALspecify a PDF document title of max. 150 characters
subjectSTRING
OPTIONALspecify a PDF document subject of max. 150 characters
creatorSTRING
OPTIONALspecify a PDF document creator name of max. 150 characters
authorSTRING
OPTIONALspecify a PDF document author name of max. 150 characters
Code Snippet
Install SDK
Response ExampleSchema

Install SDK for (Node.js)Unirest

OAuth2 Authentication
Client ID
Client Secret
OAuth2 Authentication