-
Notifications
You must be signed in to change notification settings - Fork 2
Usage ‐ PDF from HTML
Bart Don edited this page Jan 2, 2024
·
4 revisions
For generating a PDF, you can choose to use HTML. This can be done with the TTA generate PDF operation:
You can also generate PDF`s based on HTML within Directus Hooks/Endpoints/Operations. This can be done trough globalThis.TTA.
An example usage:
const fileID = await globalThis.TTA.generatePDF({
"pdfoptions": {
"html": "<h1>Hello {{name}}!</h1>",
"format": "A4",
"landscape": false,
"margin": 10,
"marginRight": 5,
"marginLeft": 500,
},
"filename": "file.pdf"
});