PDF Generation API
Generate PDF files from an HTML file, HTML string, HTML URL, or an HTML template with JSON data.
HTML to PDF
| Item | Value |
|---|---|
| Request URL | POST http://localhost:8080/api/v1/process/pdf/generation/html-to-pdf |
| Authentication | x-api-key: your_api_key_here |
| Request Type | multipart/form-data |
| Success Response | PDF file stream |
Parameters
| Field | Type | Description | Required |
|---|---|---|---|
htmlFile | File | HTML file. Mutually optional with request.html or request.htmlUrl. | No |
request.html | String | HTML string. | No |
request.htmlUrl | String | HTTP/HTTPS HTML URL. | No |
request.baseUri | String | Base URI for relative resources. | No |
request.pageSize | Object | Page width and height in pt. | No |
request.outputFileName | String | Output file name. | No |
curl Example
bash
curl -X POST "http://localhost:8080/api/v1/process/pdf/generation/html-to-pdf" \
-H "x-api-key: your_api_key_here" \
-F "[email protected]" \
-F 'request={"pageSize":{"width":595,"height":842},"outputFileName":"report.pdf"}' \
-o report.pdfTemplate to PDF
| Item | Value |
|---|---|
| Request URL | POST http://localhost:8080/api/v1/process/pdf/generation/template-to-pdf |
| Authentication | x-api-key: your_api_key_here |
| Request Type | multipart/form-data |
| Success Response | PDF file stream |
Parameters
| Field | Type | Description | Required |
|---|---|---|---|
templateFile | File | HTML template file. Mutually optional with request.template. | No |
dataFile | File | JSON data file. Mutually optional with request.data. | No |
request.template | String | HTML template string. | No |
request.data | Object/String | Template data. | No |
request.baseUri | String | Base URI for relative resources. | No |
request.pageSize | Object | Page width and height in pt. | No |
request.outputFileName | String | Output file name. | No |
curl Example
bash
curl -X POST "http://localhost:8080/api/v1/process/pdf/generation/template-to-pdf" \
-H "x-api-key: your_api_key_here" \
-F "[email protected]" \
-F 'request={"data":{"invoiceNumber":"INV-001","customer":"Acme"},"outputFileName":"invoice.pdf"}' \
-o invoice.pdf