import axios from "axios";
axios.post("http://api.transactional.dev/generate",
{ templateId: "123456789", variables: { name: "acme", anotherCustomVar: [{id: '#1'}] } },
{ headers: {"x-api-key": "tr_xxxxxx"}}
)
.then(response => console.log(response.data.url))
.catch(error => console.log(error))
Most PDF packages try to convert CSS and HTML into PDF language, which greatly limits the possibilities.
Our approach is more solid and simple, we are based directly on the Chromium rendering engine.
You can finally create PDFs simply and quickly without messing up your codebase.