Documentation

Routes

GET - /

Documentation page

POST - /html-to-pdf

POST parameters :


BODY example : { "html": "<div>Hello world !</div>", "options": { "landscape": true } }

RETURN : the pdf document

POST - /htmls-to-pdf

POST parameters :

List of html strings and options


BODY example : [ { "html": "<div>Hello world ! This is the first page</div>", "options": { "landscape": true } }, { "html": "<div>Hello world ! This is the second page</div>" } ]

RETURN : the pdf document

POST - /merge-pdfs

POST parameters :

List of base64 strings


BODY example : [ { "base64": "JVBERi0xLjMKMyAwI..." }, { "base64": "JVBERi0xLjMKMyAwI..." } ]

RETURN : the merge pdf documents

POST - /html-to-image

POST parameters :


BODY example : { "html" : "<table><thead><tr><td>Hello world !</td></tr> </thead></table>" }

RETURN : A png image, the Content-Type is image/png.

Others

Image problem

If the images are not loading properly, it might be a dns issue.
In order to resolve the problem you might want to configure it.
You can achieve that by updating the /etc/hosts file on the server.

Font problem

You can test out your font url by adding the font on this page.
If the fonts are not loading properly, it might be a server configuration issue on the resource side.
You can change the nginx configuration located in: "/etc/nginx/sites-available/xxxxxx.conf"
You might want to change the location types. location ~* \.(jpg|png|jpeg|svg|woff|woff2|ttf|otf)$ { add_header "Access-Control-Allow-Origin" *; }