# /pdf

Convert URL to PDF document, Authentication is required.

# How to use

curl -X POST https://api.browserlify.com/pdf?token=YOUR_TOKEN \
    -H 'Content-Type: application/json' \
    --output example.org.pdf \
    -d '{
    "url": "https://example.org",
    "waitLoad": 5000,
    "page": "letter",
}'

# Response

The Content-Type is application/pdf, binary stream responsed.

If the asurl=true, the Content-Type is application/json, the original result will be stored in the object storage, and a json including the url address of the result will be returned. You can directly access this url address to get your data. This url is private, please do not share it with others.

The url will expire after 48 hours, please download within this time.

Response example:

{
    "size":41513,
    "url":"https://brlify-us-1303181364.cos.na-siliconvalley.myqcloud.com/pdf/example.org.pdf"
}

# Request Options

Common options

Basic Parameters for /pdf:

Name Type Default Required Description
url string "" YES Target url. http/https are supported
asurl boolean false NO Store result to s3/cos, got a url
printBackground boolean false NO PrintBackground
landscape boolean false NO Orientation, false is Portrait, true is Landscape
paper string false NO Paper
width int 0 NO Width
height int 0 NO Height
height int 0 NO Height
margins Object {"top":0, "bottom":0, "left":0, "right":0} NO Margins:
  • top int Top margin in pixel.
  • bottom int Bottom margin in pixel.
  • left int Left margin in pixel.
  • right int Right margin in pixel.
header string "" NO Header
footer string "" NO Footer

# PDF Protection Options

For PDF Protection settings

Name Type Default Required Description
author string "" NO Author
userPassword string "" NO UserPassword
ownerPassword string "" NO OwnerPassword
noPrint boolean false NO NoPrint
noCopy boolean false NO NoCopy
noModify boolean false NO NoModify