DOCX to PDF API

Pritset helps applications generate PDF documents from DOCX templates. Instead of building a document rendering pipeline yourself, you upload a .docx template, send JSON data to the API, and receive a finished PDF.
This is useful when your system needs to create invoices, receipts, reports, contracts, healthcare documents, certificates, resumes, or other business documents automatically.
DOCX conversion vs DOCX template generationโ
A basic DOCX to PDF converter turns one finished Word document into a PDF. Pritset is built for recurring document generation: you create reusable DOCX templates, send dynamic JSON data, and generate personalized PDFs automatically through an API.
How DOCX to PDF works in Pritsetโ
Pritset is designed around reusable templates:
- Create a DOCX file in Microsoft Word, LibreOffice, or another editor that supports
.docx. - Add placeholders for dynamic values, loops, images, links, tables, or charts.
- Upload the template in the Pritset portal.
- Send JSON data through the API.
- Receive a generated PDF document.
The DOCX file stays editable by business users, designers, or operations teams, while developers integrate the API once and keep document generation inside the product workflow.
Why use DOCX templatesโ
DOCX is a practical format for business documents because many teams already know how to edit it. Your team can adjust layout, wording, tables, logos, headers, footers, and spacing without changing application code.
Pritset then uses that template as the source for generated PDFs. The API fills the template with request data and returns the result in PDF format, so the final document is ready to store, send, print, or attach to a customer workflow.
Typical use casesโ
Pritset can generate many document types from the same template-based flow:
| Use case | Example data |
|---|---|
| Invoices | Customer details, line items, tax, totals, company logo |
| Receipts | Payment date, order number, purchased items, total amount |
| Reports | Sections, tables, charts, images, summaries |
| Contracts | Parties, dates, addresses, terms, signature fields |
| Healthcare reports | Patient or case data, measurements, charts, recommendations |
| Certificates | Recipient name, issue date, certificate number |
You can see ready examples in the examples section.
Template data exampleโ
A template can include placeholders such as {{customer.name}}, {{invoice.id}}, or loops for table rows.
Example API data:
{
"invoice": {
"id": "INV-1024",
"date": "2026-07-09"
},
"customer": {
"name": "Acme Ltd",
"address": "12 Market Street"
},
"items": [
{
"description": "Document generation",
"quantity": 1,
"total": "$120.00"
},
{
"description": "Template setup",
"quantity": 1,
"total": "$80.00"
}
],
"total": "$200.00"
}
Inside the DOCX template, you can insert values:
Invoice {{invoice.id}}
Customer: {{customer.name}}
Total: {{total}}
For repeating rows, use a loop:
{{FOR item IN items}}
{{$item.description}} - {{$item.quantity}} - {{$item.total}}
{{END-FOR item}}
Read the full templating syntax guide for supported values, loops, images, links, tables, and charts.
Direct and webhook processingโ
Pritset supports two common processing modes.
Direct requestโ
Use a direct request when your application wants to receive the generated PDF in the API response.
curl -X POST "https://api.pritset.com/api/template/process/direct/{templateId}" \
-H "X-API-Token: YOUR_TOKEN" \
-H "X-API-Secret: YOUR_SECRET" \
-F 'data={
"invoice": { "id": "INV-1024", "date": "2026-07-09" },
"customer": { "name": "Acme Ltd" },
"total": "$200.00"
}'
Response will be a PDF file, which you can save or send to the user.
This is a good fit for synchronous workflows where the document is expected to be generated quickly and your application can wait for the response.
Webhook requestโ
Use a webhook request when processing should happen asynchronously. Pritset accepts the job, returns an ID, and calls your webhook URL when the generated PDF is ready.
POST https://api.pritset.com/api/template/process/webhook/{templateId}
-H "X-API-Token: YOUR_TOKEN" \
-H "X-API-Secret: YOUR_SECRET" \
-F 'data={
"invoice": { "id": "INV-1024", "date": "2026-07-09" },
"customer": { "name": "Acme Ltd" },
"total": "$200.00"
}'
-F 'url=https://yourapp.com/webhook-endpoint'
Repospose will be a job ID, and your webhook endpoint will receive a POST request with the generated PDF when ready.
This is useful for longer documents, background jobs, or systems that already use event-based workflows.
What to prepare before calling the APIโ
Before making a DOCX to PDF request, you need:
- a Pritset account;
- an uploaded DOCX template;
- the template ID from the portal;
- an access token and secret from your profile page;
- JSON data matching the placeholders in your template.
The request body uses multipart/form-data. Include the data field with the JSON payload. For webhook processing, also include the url field with your webhook endpoint.
Learn more in the API documentation and template processing guide.
Practical notesโ
Generated documents should always be checked before production use. Complex DOCX files can depend on fonts, embedded assets, layout choices, or document features that may render differently between systems.
For best results:
- keep templates focused and predictable;
- use supported template syntax for dynamic content;
- test templates with realistic JSON data;
- keep independent copies of source templates;
- save generated PDFs immediately after receiving them.
Pritset charges only for successfully generated documents under the current credit-based model. New accounts can start testing with free request credit after registration.
Next stepsโ
FAQโ
What is a DOCX to PDF API?
A DOCX to PDF API lets an application generate or convert PDF documents from Microsoft Word files. Pritset focuses on template-based generation: you upload reusable DOCX templates, send JSON data, and generate finished PDFs automatically.
Is Pritset only a DOCX converter?
No. Pritset is designed for recurring document generation, not only one-off conversion. It helps applications generate many personalized PDFs from reusable Word templates and structured data.
Can non-developers edit the templates?
Yes. Business users, designers, or operations teams can update layouts in Microsoft Word or another DOCX editor. Developers only need to keep the API integration connected to the template data.
Does Pritset support asynchronous PDF generation?
Yes. Use direct processing when your application should receive the PDF immediately. Use webhook processing when document generation should happen in the background.