.
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
.
html
String
required. Include any CSS either inline or by reference to url
.
Response. One of the following:
.
plain text
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:
PDF title
Use the title tags inside your html head:
My PDF title
...
Print-only CSS
Use the CSS @media print directive, for example:
@media print {
body {
margin: 12px;
}
}
Test mode