How to start with Swagger

Swagger url: documentation

Set up Authorization

1) Open the swagger and click on Authorize

2) Copy the username and password from Developers page

3) Fill the authorization in swagger and click Authorize

Use the API for conversion

1) Choose the end point

2) We will use HTML for example. Click on Try it out.

3) Update html with your own code and update with your css site or delete the styleUrl. I will use for example "html": "<html><h1>Hello World!</h1></html>", and I will delete "styleUrl": "" because I do not use user style URL with CSS.

Json example of the body

{ "html": "<html><h1>Hello World!</h1></html>", "styleContent": "h1 {color: red}", "emulateMediaType": "print", "outputFormat": "pdf", "outputFileName": "html-coverted-to-pdf", "outputDetail": { "scale": 1, "displayHeaderFooter": false, "headerTemplate": null, "footerTemplate": null, "printBackground": false, "landscape": false, "pageRanges": "", "format": "Letter", "width": 800, "height": 600, "margin": null, "preferCSSPageSize": false, "omitBackground": false }, "htmlLoadOptions": { "timeout": 0, "waitUntil": [ "load" ] } }

4) Click on Execute

5) Response from the server have to be 200 and you will see link for download the file

6) After open of the PDF you will see HTML code

Davame.s.r.o© Copyright 2021. All Rights Reserved.