Jetformat

Word to PDF and DOCX editing commands

Convert, inspect, and edit existing DOCX files. Reads are free; writes are one credit per command, to-pdf one per page.

By Jetformat

The word resource is Jetformat’s command group for converting, inspecting, and modifying an existing DOCX document. Use word to-pdf when the deliverable is a PDF; use a Word editing verb when the deliverable must remain an editable DOCX.

Convert a DOCX and check its pages

  1. Validate the input with jetformat validate contract.docx.
  2. Inspect its structure with jetformat word inspect contract.docx --json and confirm the required fonts are available.
  3. Convert to a distinct path with word to-pdf below.
  4. Run jetformat pdf info contract.pdf and review text, tables, headers, and page breaks in the output. A successful exit alone does not establish layout fidelity.

to-pdf (1 credit per output page)

jetformat word to-pdf contract.docx -o contract.pdf
jetformat word to-pdf contract.docx --font-dir ./fonts --force

-o sets the output path, --font-dir adds a font directory (repeatable), --force overwrites.

inspect, tables, styles, bookmarks, comments (free)

jetformat word inspect contract.docx --json
jetformat word tables contract.docx
jetformat word styles contract.docx
jetformat word bookmarks contract.docx
jetformat word comments contract.docx
jetformat word headers contract.docx
jetformat word footnotes contract.docx
jetformat word form-fields contract.docx

template, mail-merge, fill-fields (1 credit per command)

Three different mechanisms: content controls, MERGEFIELD codes, legacy form fields.

jetformat word template letter.docx --set customer="Acme Corp" -o letter.docx --force
jetformat word mail-merge letter.docx --set Customer="Acme Corp" -o letter.docx --force
jetformat word fill-fields letter.docx --set Name=Ada -o letter.docx --force

Edit in place (1 credit per command)

jetformat word comment letter.docx --author Alice --text "fix this" -o letter.docx --force
jetformat word footnote report.docx --paragraph 1 --text "see spec" -o report.docx --force
jetformat word header report.docx --text Confidential -o report.docx --force
jetformat word toc report.docx --levels 1-3 -o report.docx --force
jetformat word watermark letter.docx --text CONFIDENTIAL -o letter.docx --force
jetformat word style report.docx --paragraph 1 --id Heading1 -o report.docx --force
jetformat word add-paragraph report.docx --text "next line" -o report.docx --force
jetformat word add-table report.docx --row Alpha,Beta -o report.docx --force
jetformat word add-image report.docx --paragraph 1 --image logo.png -o report.docx --force
jetformat word hyperlink report.docx --url https://jetformat.com --paragraph 1 -o report.docx --force
jetformat word numbering report.docx --paragraph 1 --style bullet -o report.docx --force
jetformat word props report.docx --title Report --author Ada -o report.docx --force
jetformat word remove-paragraph report.docx --paragraph 2 -o report.docx --force

These insert into an existing DOCX. There is no command that creates a document from nothing.

merge, split (1 credit per command) · extract-images (free)

jetformat word merge chapter1.docx chapter2.docx -o book.docx --force
jetformat word split report.docx -o report-parts --force
jetformat word extract-images report.docx -o report-images

Merge concatenates files. Split follows section breaks, not pages; for page ranges run word to-pdf then pdf extract. Extract-images writes embedded pictures only.

Limits

No .doc or .docm. No OCR. Fonts must be on the machine or in --font-dir.

Pick the Word operation by the document structure

Task Operation Important distinction
Deliver a fixed-layout PDF word to-pdf Billed by output pages
Populate content controls word template Requires matching controls
Populate merge fields word mail-merge Requires MERGEFIELD codes
Fill legacy form fields word fill-fields Does not target arbitrary visible text
Divide a DOCX word split Splits by sections, not rendered pages

For example, 1 template command followed by a conversion producing 12 pages uses 13 credits: 1 credit for the DOCX write and 12 credits for the PDF. Reading text or structure adds 0 credits. These are stated workload counts, not a prediction of your document’s pagination.

Preserve a recoverable source

The in-place examples use --force intentionally. During an unfamiliar workflow, change the output path to a new filename instead. Keep the source until the derivative has passed review; regenerating a PDF is easier when the filled DOCX is also retained.

DOCX is part of Office Open XML, described in ECMA-376. Format membership does not imply support for every Word feature. Use the Word conversion guide for font and pagination checks and template versus mail merge to choose a population mechanism.

Last updated