Vince Live provides a few API endpoints that will help in developing workflows.

PDF Generation

Vince Live offers a PDF generation API endpoint that can be used to create PDF files.

The endpoint uses PDFme as engine.

Creating a template

Use PDFme’s template editor to generate a layout. Set relevant field names for your fields!

image.png

When you are done with your template, use the DL Template button to download a JSON template. (This can be opened and edited again in the template editor.)

Generating the PDF

Available input properties

Property Mandatory Default Type Comment
template Yes N/A body parameter Template object downloaded from PDFme template editor
inputs Yes N/A body parameter Inputs to use for specific fields.

Example request

Note that the property names in inputs array will depend on your template configuration.

POST /v1/utils/generate-pdf

{
    "template": { /* template copied from file */ },
    "inputs": [
        {
            "tableData": [
	            ["Row 1 Col 1", "Row 1 Col 2", "Row 1 Col 3" ],
	            ["Row 2 Col 1", "Row 2 Col 2", "Row 2 Col 3" ]	            
            ],
            "invoiceNumber": "ABC34567890",
						"logo": "data:image/png;base64,iVBORw0KGgoAAA..."
				}
			]
}

<aside> <img src="/icons/warning_yellow.svg" alt="/icons/warning_yellow.svg" width="40px" />

For tables, note that you need to provide an array of arrays as input.

</aside>

Example result