Output Formats
The same document definition renders as a PDF or as a DOCX (a Word document). Nothing in the definition changes between the two: the format is chosen when you ask for the document, and each writer carries the definition as far as its format allows. What a format cannot carry is reported, never dropped in silence.
Choosing the format
The format is the last segment of the generation path:
| Path | Output |
|---|---|
…/documents/generate/pdf | |
…/documents/generate/docx | DOCX |
…/documents/generate | PDF: with no segment, the format is PDF |
The same holds for a stored template, sent to the same path. Any other format is answered 400. See Generate.
The PDF side
Two metadata keys shape the PDF file itself. Neither has any effect on a DOCX.
| Key | Takes | Default | What it does |
|---|---|---|---|
pdfVersion | "1.7", "2.0" | follows the claims | pins the PDF version. A claim the pin contradicts is refused before rendering |
objectStreams | boolean | false | true stores the file's objects in compressed object streams, a fifth or more smaller when the document is heavily tagged; false writes the classic cross-reference table |
Without a pin the output is PDF 1.7, unless a conformance claim defined over PDF 2.0 asks for 2.0:
- the
a-4archival claim; - the
ua-2accessibility claim, or a Well-Tagged PDF level (wtpdf-accessibility,wtpdf-reuse).
Nothing else changes the version. What is defined over PDF 2.0 alone (encryption.encryptionType: "aes256Gcm", a signature made with an ECDSA key or over a SHA-3 digest) needs a document that states PDF 2.0, by the pin or by one of those claims.
On 2.0, the archival default becomes PDF/A-4. Which claims stand on which version is on Conformance.
"metadata": { "title": "Survey report", "pdfVersion": "2.0", "objectStreams": true }
The DOCX side
Conformance class
A DOCX is written in one of the two classes of Office Open XML (ISO/IEC 29500), named in metadata.conformance.docx:
| Value | Class |
|---|---|
transitional | Transitional, the class a document that claims none is written in |
strict | Strict |
{
"document": {
"metadata": {
"title": "Survey report",
"lang": "en",
"conformance": { "docx": ["strict"] }
},
"content": [
{ "h1": "Survey report" },
{ "p": "Findings of the 2026 inspection." }
]
}
}
A claimed class is produced as claimed. Strict has no vector shapes and no text boxes, so under strict these are left out or moved, each reported:
- svg drawings and watermarks are not written;
- a visible signature is not drawn: the package is still signed;
- a block with
position: fixedstays in the flow; - faded text (
opacity, or a watermark's) loses its fade, and outlined text its colour and width; - a barcode drawn with hexagons or circles, and a barcode's human-readable characters, are not written;
- a checkbox or radio button keeps its glyph but not its toggle.
Fonts
Every family declared in document.fonts is embedded in the DOCX, subset to the characters the document holds, as far as the face's licence allows: a face whose licence forbids embedding is left out and reported, and one that forbids subsetting goes in whole. Text with no fontFamily is written in Arial.
In the PDF, a character the declared family lacks is drawn from one of the engine's built-in script faces. A DOCX can only name the faces it carries, so for those characters Word substitutes a face of its own: the text is the same, the shapes may differ slightly. To match the PDF exactly, declare a family that covers every script the document uses. See Fonts.
Form fields
Each form field is a Word content control, fillable in Word as the PDF's field is in a PDF reader:
| Field | Content control |
|---|---|
text | plain text |
textArea | rich text |
choice | drop-down list |
listBox | combo box |
checkbox, radio | check box |
| a date picker | date picker, with the author's format and the document's locale; Word opens a calendar |
A radio group's exclusivity has no equivalent, so each button is its own check box, and this is reported.
Mathematics
A [latex] formula is a native Word equation, editable in Word. Word sets it in its own face and spacing, so an equation does not measure exactly as in the PDF.
What the DOCX carries differently
Word lays out a DOCX itself, so page breaks, line breaks and header heights are Word's decisions. The rest of the definition is written as below. "Reported" means the render's diagnostics name what was left out or changed.
| Feature | In the DOCX |
|---|---|
Conformance claims in conformance.pdf, pdfVersion, objectStreams | PDF only. The DOCX claims its class in conformance.docx |
| Accessibility tagging | no tagging. Headings keep their outline level, an image's alt is the picture's description, an svg's title the drawing's title, and each paragraph its language |
[abbr] | the expansion is not carried (reported) |
use with as | not carried: Word has no element for a quotation, an aside or an article (reported) |
| E-signature | the package is signed (XML Signature with XAdES) with the same key. certificationLevel other than noChanges, fieldLock, signingType: "Detached", contactInfo, signatureCreator, claimedSignDate and appearance.image are not carried (reported). Under strict the visible signature is not drawn |
| Encryption | userPassword encrypts the file with AES-256; ownerPassword and permissions become Word's editing restriction. print, copy, assemble, printHighQuality, encryptMetadata and encryptEmbeddedFilesOnly are not carried (reported) |
| Attachments | not carried: one warning per file, naming its members |
Bookmarks (outlines) | an authored tree is not carried (reported). Headings keep their outline level, so Word's navigation pane lists them |
metadata.viewerPreferences | not carried (reported) |
| Form fields | content controls, as above. A radio group's exclusivity, a signature field's reservation, its lock and seedValue, and a text area's box height are not carried (reported) |
| Table header rows | marked as header rows; Word decides where they repeat |
| Headers and footers | a band taller than its space moves the body down in Word, where the PDF leaves the body in place |
| Watermarks | drawn behind the text from the page header. Not written under strict |
| svg | a Word drawing. A dash offset, most clips, and rotated or skewed text in svg are not carried (reported). Not written under strict |
| Barcodes | drawn as in the PDF. Under strict, see the list above |
opacity | faded text is kept; the fade of a paragraph's fill and border, and of a list, table, rule or columns block, is not carried (reported) |
textJustify: "interCharacter" | lines justified between words instead (reported) |
textAlignLast other than the paragraph's own alignment | not carried (reported) |
writingMode verticalRl, verticalLr | written horizontally (reported) |
clipPath, overflowX/overflowY clips | the block is drawn whole, in its box (reported) |
| A list's picture marker | written at the PDF's size; Word sizes the marker itself |
| A bordered list item | Word draws the box around the number as well as the text |
| Pages numbered in a counter style Word lacks | numbered in decimal; circle and square as a bullet (reported) |
pageSetup.mirrorMargins in only some sections | no page mirrors: Word holds the setting for the whole document (reported) |
| A page or margin over 22 inches | held to 22 inches (reported) |
| A section with more than 45 columns | held to 45 (reported) |
| Links | a link whose target is not http, https or mailto, or not an absolute address, is not carried (reported) |
| Diagnostics appendix | written in both formats |
Proofs
The visual proofs render the same definition to both formats so they can be opened side by side: proof-docx-package-properties (title, author and subject in Word's File > Info), proof-docx-package-signature (a signed package), proof-docx-password-to-open (one encryption block for both files), proof-docx-field-placeholders (content controls), proof-docx-list-contents, proof-docx-table-cells, proof-docx-shaped-subset (shaped scripts in subset faces), proof-docx-attachments (what the DOCX reports for each attached file), and proof-signed-confidential (an encrypted, signed PDF that keeps its accessibility claim).