Skip to content
pdfconversionapi

DOTX to PDF API

Send a Word template to POST /v2/convert/dotx/to/pdf and get a PDF of the template as a new document would open from it. The sample catering quote asks for PdfaVersion=pdfA2b and comes back as a one-page A4 PDF/A-2b of 70,008 bytes.

Endpoint
POST /v2/convert/dotx/to/pdf
Accepts
dotx
Sample timing
0.581 s median of 5 runsHow we measure
Request size
Up to 10 MB on the Free plan or 100 MB on paid plans, all files together

Request and response

Every sample below ran against the API before this page was published. Set PDFCONVERSIONAPI_KEY to your key and run it as is.

curl -sS -X POST \
  https://api.pdfconversionapi.com/v2/convert/dotx/to/pdf \
  -H "Authorization: Bearer $PDFCONVERSIONAPI_KEY" \
  -F File=@catering-quote.dotx \
  --form-string PdfaVersion=pdfA2b \
  -o response.json

# FileData is base64. Save the first file in converted/,
# or print the JSON error.
if jq -e '.Files' response.json > /dev/null; then
  mkdir -p converted
  name=$(jq -r '.Files[0].FileName' response.json)
  jq -r '.Files[0].FileData' response.json \
    | base64 --decode > "converted/$name"
else
  cat response.json
fi
200 OK0.581 s median1 file, 68 KB
{
  "ConversionCost": 1,
  "ConversionTime": 0.581,
  "Files": [
    {
      "FileName": "catering-quote.pdf",
      "FileExt": "pdf",
      "FileSize": 70008,
      "FileData": "JVBERi0xLjcKJcOkw7zDtsOf…"
    }
  ]
}

Response from our test run on 2026-11-03. ConversionTime shows the median of 5 runs. FileData is shortened here; the real response carries the whole file as base64.

The sample, converted

The same file the code sends. Download the input and the output and compare them yourself.

First page of catering-quote.pdf, rendered by the API
Input
catering-quote.dotx (40 KB)
Output
catering-quote.pdf (68 KB)
Source
A one-page catering quote template for a fictional bakery, written for this site and saved as a Word template, with a fill-in content control, a date field and a price table. (CC0-1.0). How it was made
Made by
2026-11-04, API build 9eeeb0640aba

Parameters

Send these as form fields next to the file. Names are case-insensitive. If you set one of the documented options below that we don't support yet, the request fails with a 400 that names it instead of returning a file made without it.

ParameterWhat it does
PdfaVersionenum, default noneWrite an archival PDF/A file of part 1, 2 or 3, conformance B. The sample's XMP metadata says part 2, conformance B. Sent together with Pdfa=true, PdfaVersion decides: pdfA3b plus Pdfa=true gave a part 3 file.Values: none, pdfA1b, pdfA2b, pdfA3b
Pdfaboolean, default falseShortcut for PDF/A-1b, ConvertAPI's meaning of Pdfa=true.
PageRangestringPages to keep from a multi-page template, such as 1 or 2-last. A range that leaves pages out can't be combined with PDF/A yet; on the one-page sample, PageRange=2 returns 400 "PageRange asks for page 2, but the document has 1 page".Values: e.g. 1, 2-last
PasswordstringPassword of an encrypted .dotx. Our test template, encrypted with a password, gave the same PDF as the plain file when the password was sent, and 422 when it was missing or wrong.
FileNamestringName for the PDF, without .pdf; by default the template's name, catering-quote.pdf.
StoreFileboolean, default falseReturn a link that expires after 3 hours instead of the PDF itself.

Not supported yet

Setting one of these to anything but its default returns 400.

OptionWhat to do instead
IncludeMarkuptrue returns 400 "IncludeMarkup is not supported yet for DOTX files".
UpdateTableOfContentsNot available for templates; true returns 400.
IncludeStructureTagstrue returns 400. The PDF already has a structure tree.
SubsetFontsFonts are always embedded as subsets; only false is accepted.

Also refused when set: BookmarkMode, IncludeMetadata.

What carries over, and what doesn't

Kept

  • The A4 page (595.3 × 841.9 points), logo, title, price table with its shaded header and bold total, and the bullet list
  • Content control placeholders, printed in gray: "Click here to enter the client's name."
  • The footer's page fields: "Quote template, page 1 of 1"
  • Bookmarks for the two headings, Order and Terms
  • Title and author from the template; tagged structure, language en-US
  • Fonts embedded as subsets: Caladea for the Cambria body text, Carlito for the Calibri headings, OpenSymbol for the bullets

Lost or not yet supported

  • The date saved in the template. Its DATE field is refreshed when the template opens, so the sample prints "November 4, 2026", the day of the conversion, not the saved "January 5, 2027".
  • Fillable fields: the content control becomes static gray text, not a form field.
  • The original Cambria and Calibri faces, replaced by metric-compatible fonts.

Limits

  • Requests up to 10 MB on the Free plan or 100 MB on paid plans, all files and fields together.
  • 120 seconds per conversion, then 504.
  • A PageRange that leaves pages out plus PDF/A returns 400 for now.
  • Macros in the template never run: each conversion starts the office suite with a new profile that has macros switched off.

Where teams use it

Showing customers a document before it is filled in

A quote or contract template can be published as a PDF so clients see the layout, terms and price table ahead of time. Placeholder text tells them what will be filled in.

Long-term records of the templates in use

Legal and compliance teams keep a PDF/A copy of each version of a template, so it is clear later which wording was current on a given date.

Questions

Why does the date in the PDF differ from the one in my template?

A DATE field shows the current date whenever the document opens, and the conversion is such an opening. The sample's field was saved as January 5, 2027 and printed November 4, 2026, the day we converted it. Replace the DATE field with typed text if the date must stay fixed.

Do placeholder texts appear in the PDF?

Yes. A content control that is still showing its placeholder prints that text, in the gray the template gives it. Fill the control or remove its placeholder before converting if you want an empty line.

Which PDF/A versions can I get?

1b, 2b and 3b, through PdfaVersion (or Pdfa=true for 1b). The accessible "a" and Unicode "u" levels are not offered: PdfaVersion=pdfA2u returns 400.

Can I send a .docx to this route?

It works: in our test a .docx sent here converted to a 2-page PDF. Use /v2/convert/docx/to/pdf for documents, though, since it reads the options that matter for them, like refreshing a table of contents.

Convert your first DOTX file in a minute.