.

perfectpdf: an html to pdf api
from scideas software

.

perfectpdf api definition

.
endpoint
https://services.scideas.net/perfectpdf/api
no specific headers required
.
method
POST
JSON in body of POST
.
POST fields
.
api_key
String <api key>
required
.
html
String <html markup code>
required. Include any CSS either inline or by reference to url
.
Response. One of the following:
.
plain text
<PDF document>
.
plain text
<error message>
for example, Error: html empty
.

perfectpdf api data preparation

The perfectpdf api will render any html string but CSS formatting must be included.

Some common formatting tasks particularly relevant to PDF documents are shown below.

PDF page size

Use the CSS @page directive, for example: @page { size: A4; margin: 30mm 10mm 80mm 25mm; }

Pagination

Include suitable CSS, for example: .pagebreak { page-break-before: always; /* page-break-after works, as well */ width:100%; height:60px; display:block; margin-bottom:60px; } Insert suitable html into your document where you require page breaks, for example: <div class="pagebreak"></div>

PDF title

Use the title tags inside your html head: <head> <meta charset="UTF-8"> <title>My PDF title</title> ... </head>

Print-only CSS

Use the CSS @media print directive, for example: @media print { body { margin: 12px; } }
.

OAS3

Download the openapi 3.0.0 definition file for perfectpdf


Test mode