The short rule: generate DOCX when somebody has to edit or countersign the document, and PDF when the document is a final record that must look the same everywhere. Contracts, offer letters and internal procedures are DOCX. Invoices, receipts, certificates and anything you archive or print are PDF.
With DocMake you do not have to commit at design time. One template produces both, and the choice is a single parameter on the render call: "format": "docx" or "format": "pdf". If you omit it entirely, you get DOCX, because the API was built Word-first. Many teams render PDF for the customer and DOCX for the internal file in the same request cycle.
What actually happens in each case
The two formats are produced by two different renderers driven by the same resolved document tree.
DOCX is assembled as real Office Open XML. Paragraphs, headings, tables, lists, page breaks, text styles, headers, footers, page numbers and images are written as native Word structures, not as an image or an embedded PDF. The file opens and edits like any document authored in Word.
PDF is printed by headless Chromium from the same HTML and CSS the editor preview uses. That is why the preview and the PDF agree: it is literally the same layout engine. A typical render takes a few hundred milliseconds, and a single render is synchronous, so the HTTP response body is the file.
Both formats accept the same page sizes (a4, letter, legal) and both go through the identical variable, conditional and loop resolution described in template variables, conditionals and loops explained.
The honest caveat about DOCX
A PDF carries its own fonts and its own page geometry. Open it on any machine and it is the same document, which is exactly why it is the right container for an invoice or a signed certificate.
A DOCX does not work that way. Word lays the document out on the recipient’s machine, with the fonts installed there. If your template uses a face they do not have, Word substitutes something and your line breaks move. This is a property of the format, not of any particular tool, and it is the single most common surprise when teams switch from “we email PDFs” to “we email Word files”.
DocMake reduces the blast radius in two ways. First, the bundled font library resolves Microsoft families to free, metric-compatible twins: Arial renders as Arimo, Times New Roman as Tinos, Courier New as Cousine, Calibri as Carlito, Cambria as Caladea, Georgia as Gelasio. Metric-compatible means the glyph widths match, so line breaks land in the same places whether the recipient has the Microsoft font or the substitute.
Second, fonts your team uploads yourself are embedded directly into the DOCX, using the obfuscated ODTTF embedding defined in ECMA-376 section 17.8, so a recipient who has never seen your brand typeface still sees the document as designed. Bundled substitutes are deliberately not embedded, because redistributing them inside every generated file is not what their licenses are for.
PDF has no such split: every family the document actually uses is inlined into the file as a base64 web font before Chromium prints it, so a PDF is self-contained by construction.
Choose DOCX when
- The document is a draft in a negotiation. Contracts, statements of work and NDAs go back and forth with tracked changes and comments. Sending a PDF makes the other side retype it. See the service agreement and mutual NDA templates.
- A human finishes the document. Offer letters where a recruiter adds a personal paragraph, or an employment contract that needs a clause the template does not cover.
- The document lives in a quality system. ISO-style controlled procedures are revised, reviewed and reissued; a Word master that people can edit is the point.
- Your customer asked for it. Enterprise procurement and public-sector tenders still ask for editable Word deliverables surprisingly often.
Choose PDF when
- The document is a financial or legal record. Invoices, receipts and credit notes should not be editable by the recipient, and you want the archived copy to match what you sent.
- It gets printed. Certificates, work orders and site reports need exact page geometry, and a PDF has the page size baked in.
- It is attached to an email or a portal. Everything opens a PDF: phones, browsers, ticketing systems. Nothing needs Word installed.
- You care about the pixel result. If the document has a designed cover page or a tight table, PDF is what guarantees the recipient sees what you saw.
Rendering both from one call is fine
Because the format is a parameter, generating a pair costs two requests against the same template and the same payload:
const formats = ['pdf', 'docx'];
const files = await Promise.all(
formats.map(async (format) => {
const res = await fetch('https://app.docmake.io/api/v1/render', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.DOCMAKE_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
template_id: 'tmpl_ne1EfQns2YBH',
format,
strict: true,
data: contract,
}),
});
if (!res.ok) {
throw new Error(`${format} render failed: ${res.status}`);
}
return { format, buffer: Buffer.from(await res.arrayBuffer()) };
}),
);
Each render counts as one document against your monthly quota, so a PDF plus DOCX pair costs two. On the Free plan that is 1,000 documents a month, on Pro 10,000. Watch X-RateLimit-Remaining if you fan out renders in parallel: Free allows 30 requests a minute, Pro 120.
Content types, for the code that saves the file
- DOCX:
application/vnd.openxmlformats-officedocument.wordprocessingml.document, extension.docx - PDF:
application/pdf, extension.pdf
Both responses set Content-Disposition with a server-side filename, which you can override per render with the filename parameter (no extension; the API appends the right one).
A note on tools that only do one
Plenty of good document APIs are PDF-only. PDFMonkey, for example, generates PDFs from HTML and CSS templates and does it cheaply. That is a fine fit if you will never need a Word file, and a hard wall the day a customer asks for one, because an HTML template has no DOCX to give.
The opposite trap exists too: a DOCX-first tool that produces PDFs by converting the Word file afterwards, where the conversion introduces its own drift. Producing both from one resolved document tree, with a renderer built for each target, is the reason the two outputs agree.
If you are weighing options, our comparison pages list, per competitor, exactly which formats each one emits, including the ones that beat us on range: Carbone also covers XLSX, PPTX and ODS, which DocMake does not.
Start here
Try both on the same template and look at the results side by side before you standardize. The Free plan covers 1,000 documents a month with no card, which is more than enough to render your real invoice both ways and show it to whoever has to sign off. The full parameter list is on the developers page.