Convert API

get
Get

https://api.wepdf.io/v1/render
This endpoint allows you render the pdf file from url.
Request
Response
Request
Headers
Content-Typee
required
string
application/json
Query Parameters
apikey
required
string
YOUR_API_KEY
url
required
string
URL to render as PDF. (required)
output
optional
string
Specify the output format. Possible values: pdf or screenshot.
emulateScreenMedia
optional
boolean
Emulates @media screen when rendering the PDF.
scrollPage
optional
boolean
Scroll page down before rendering to trigger lazy loading elements.(default: false)
waitFor
optional
number
Number in ms to wait before render or selector element to wait before render.
attachmentName
optional
string
If set it, the browser will download this PDF instead of showing inline. This option is used as file name.
viewport_width
optional
number
Viewport width.(default: 1600)
viewport_height
optional
number
Viewport height.(default: 1200)
deviceScaleFactor
optional
number
Device scale factor (could be thought of as dpr).(default:1)
isMobile
optional
boolean
Whether the meta viewport tag is taken into account.(default: false)
hasTouch
optional
boolean
Specifies if viewport supports touch events.(default: false)
isLandscape
optional
boolean
Specifies if viewport is in landscape mode.(default: false)
timeout
optional
number
Maximum navigation time in milliseconds, defaults to 30 seconds, pass 0 to disable timeout.(default: 30000)
waitUntil
optional
string
When to consider navigation succeeded. Options: load, networkidle. load = consider navigation to be finished when the load event is fired. networkidle = consider navigation to be finished when the network activity stays "idle" for at least goto.networkIdleTimeout ms.(default: "networkidle")
networkIdleInflight
optional
number
Maximum amount of inflight requests which are considered "idle". Takes effect only with goto.waitUntil: 'networkidle' parameter.(default:2)
networkIdleTimeout
optional
number
A timeout to wait before completing navigation. Takes effect only with waitUntil: 'networkidle' parameter.(default:2000)
scale
optional
number
Scale of the webpage rendering.(default:1)
printBackground
optional
boolean
Print background graphics.(default:false)
displayHeaderFooter
optional
boolean
Display header and footer.(default: false)
headerTemplate
optional
string
HTML template to use as the header of each page in the PDF.
footerTemplate
optional
string
HTML template to use as the footer of each page in the PDF.
landscape
optional
boolean
Paper orientation
pageRanges
optional
string
Paper ranges to print, e.g., '1-5, 8, 11-13'. Defaults to the empty string, which means print all pages.
format
optional
string
Paper format. If set, takes priority over width or height options.(default:A4)
pdf_width
optional
string
Paper width, accepts values labeled with units.
pdf_height
optional
string
Paper height, accepts values labeled with units.
margin_top
optional
string
Top margin, accepts values labeled with units.
margin_right
optional
string
Right margin, accepts values labeled with units.
margin_bottom
optional
string
Bottom margin, accepts values labeled with units.
margin_left
optional
string
Left margin, accepts values labeled with units.
fullPage
optional
boolean
When true, takes a screenshot of the full scrollable page.(default : true)
quality
optional
number
The quality of the JPEG image, between 0-100. Only applies when screenshot.type is jpeg.
omitBackground
optional
boolean
Hides default white background and allows capturing screenshots with transparency.(default :false)
clip_x
optional
number
Specifies x-coordinate of top-left corner of clipping region of the page.
clip_y
optional
number
Specifies y-coordinate of top-left corner of clipping region of the page.
clip_width
optional
number
Specifies width of clipping region of the page.
clip_height
optional
number
Specifies height of clipping region of the page.
Response
200: OK
Render PDF successfully.
{response:{body:pdf_binary_file,statusCode:200,statusMessage:"OK",...}}
400: Bad Request
You passed some query parameters are not allowed.
401: Unauthorized
Your api key is incorrect.
{'message': 'Api is incorrect"', 'code': 401}

post
Post function

https://api.wepdf.io/v1/render
This endpoint allows you render PDF file from HTML content. The query parameters is the same with GET method without url params. This endpoint is not allowed "url" parameter in the query.
Request
Response
Request
Headers
Content-Type
required
string
text/html
Query Parameters
apikey
required
string
YOUR_API_KEY
output
optional
string
Specify the output format. Possible values: pdf or screenshot.
emulateScreenMedia
optional
string
Emulates @media screen when rendering the PDF.
scrollPage
optional
boolean
Scroll page down before rendering to trigger lazy loading elements.(default: false)
waitFor
optional
number
Number in ms to wait before render or selector element to wait before render.
attachmentName
optional
string
If set it, the browser will download this PDF instead of showing inline. This option is used as file name.
viewport_width
optional
number
Viewport width.(default: 1600)
viewport_height
optional
number
Viewport height.(default: 1200)
deviceScaleFactor
optional
number
Device scale factor (could be thought of as dpr).(default:1)
isMobile
optional
boolean
Whether the meta viewport tag is taken into account.(default: false)
hasTouch
optional
boolean
Specifies if viewport supports touch events.(default: false)
isLandscape
optional
boolean
Specifies if viewport is in landscape mode.(default: false)
timeout
optional
number
Maximum navigation time in milliseconds, defaults to 30 seconds, pass 0 to disable timeout.(default: 30000)
waitUntil
optional
string
When to consider navigation succeeded. Options: load, networkidle. load = consider navigation to be finished when the load event is fired. networkidle = consider navigation to be finished when the network activity stays "idle" for at least goto.networkIdleTimeout ms.(default: "networkidle")
networkIdleInflight
optional
number
Maximum amount of inflight requests which are considered "idle". Takes effect only with goto.waitUntil: 'networkidle' parameter.(default:2)
networkIdleTimeout
optional
number
A timeout to wait before completing navigation. Takes effect only with waitUntil: 'networkidle' parameter.(default:2000)
scale
optional
number
Scale of the webpage rendering.(default:1)
printBackground
optional
boolean
Print background graphics.(default:false)
displayHeaderFooter
optional
boolean
Display header and footer.(default: false)
headerTemplate
optional
string
HTML template to use as the header of each page in the PDF.
footerTemplate
optional
string
HTML template to use as the footer of each page in the PDF.
landscape
optional
boolean
Paper orientation
pageRanges
optional
string
HTML template to use as the header of each page in the PDF.
format
optional
string
Paper format. If set, takes priority over width or height options.(default:A4)
pdf_width
optional
string
Paper width, accepts values labeled with units
pdf_height
optional
string
Paper height, accepts values labeled with units.
margin_top
optional
string
Top margin, accepts values labeled with units.
margin_right
optional
string
Right margin, accepts values labeled with units.
margin_bottom
optional
string
Bottom margin, accepts values labeled with units
margin_left
optional
string
Left margin, accepts values labeled with units.
fullPage
optional
boolean
When true, takes a screenshot of the full scrollable page.(default : true)
quality
optional
string
The quality of the JPEG image, between 0-100. Only applies when screenshot.type is jpeg.
omitBackground
optional
boolean
Hides default white background and allows capturing screenshots with transparency.(default :false)
clip_x
optional
number
Specifies x-coordinate of top-left corner of clipping region of the page.
clip_y
optional
number
Specifies y-coordinate of top-left corner of clipping region of the page.
clip_width
optional
number
Specifies width of clipping region of the page.
clip_height
optional
number
Specifies height of clipping region of the page.
Body Parameters
body
required
string
the content of html to render PDF
Response
200: OK
Render PDF successfully.
{response:{body:pdf_binary_file,statusCode:200,statusMessage:"OK",...}}
400: Bad Request
You passed some query parameter is not allowed.
401: Unauthorized
Your API key is incorrect.
{'message': 'Api is incorrect"', 'code': 401}