Authentication is done by simply passing apiKey parameter to the request, using GET or POST method. You will get the apiKey parameter to your email after the registration.
A simple example could be like this:
Parameter | Type | Description | Default |
---|---|---|---|
html | string | HTML code or website URL you want to generate | required |
apiKey | string | Your api key which you will get after registration, and can find in a dashboard | required |
callBackUrl | string | Generates document in a background and sends result in your callback url. We will send generated pdf document (encoded with base64) to your provided callback url in this structure: {"document": "..."} | null |
state | string | This is custom parameter provided by the user which will be sent to the callBackUrl when document is generated. | null |
landscape | boolean | Activates landscape mode | false |
format | string | Format of the document, can have one of values:Letter, Legal, Tabloid, Ledger, A0, A1, A2, A3, A4, A5, A6 | A4 |
width | integer | Custom width of the pdf size (use in conjunction with height parameter) | null |
height | integer | Custom height of the pdf size (use in conjunction with width parameter) | null |
marginTop marginRight marginBottom marginLeft | integer | Empty spaces between the outer and the beginning of the content (integer value which is equal to pixels) | 0 |
filename | string | Filename header will be returned | null |
waitFor | integer | Parameter to wait for some time (in seconds) before generate the pdf document. It is useful if you have some javascript code running in the background after page was loaded. Available values from 0 to 10 . | 0 |
media | string | Use value to generate pdf using print mode styles, can have one of values: print , screen | screen |
scale | number | Defines the scale of the pdf document content. Scale range is from 0.1 to 2 | 1 |
headerTemp footerTemp | string | Parameter to provide header / footer of the page. HTML code should be provided and used in conjunction with marginTop / marginBottom to be visible | null |
We support fonts listed bellow.
Andale Mono | Comic Sans MS | NotoSans | Verdana |
Arial | Courier New | NotoSerif | Webdings |
Arial Black | Georgia | Tahoma | |
Arial Narrow | Impact | Times New Roman | |
Arial Unicode | Microsoft Sans Serif | Trebuchet MS |
A HTML code example if you want to force a page break at a certain point in an HTML document:
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<title>Paginated HTML</title>
<style>
div.page
{
page-break-after: always;
page-break-inside: avoid;
}
</style>
<head>
<body>
<div class="page">
<h1>This is Page 1</h1>
</div>
<div class="page">
<h1>This is Page 2</h1>
</div>
<div class="page">
<h1>This is Page 3</h1>
</div>
</body>
</html>