Skip to content
ComPDF
DemoAPI ReferenceFAQ

PDF Generation Template Editor

Open-source visual PDF generation engine with customizable templates and developer-friendly APIs.

View on GitHub

Template to PDF API

BASE URLhttp://localhost:8090/

❖ Feature Description

Before calling this API, follow the How to Use guide to run the project. Generate a PDF from an HTML template and optional JSON data.

Generate PDF from a template

POSThttp://localhost:8090/api/v1/process/pdf/generation/template-to-pdf

❖ Request Parameters

Body Parameters multipart/form-data

No file selected
HTML template file. Use this or request.template below.
No file selected
JSON data file. Use this or request.data below.
JSON string that can contain:
request.template: HTML template string.
request.data: template data.
request.baseUri: base path or URL for relative resources.
request.pageSize: page width and height in pt.
request.outputFileName: output filename.
🔗Request Example
curl --request POST \
+  --url http://localhost:8090/api/v1/process/pdf/generation/template-to-pdf \
+  --form [email protected] \
+  --form [email protected]
Response Example
200 OK
null