Server-side and serverless conversion
Process DOCX files in a Node.js application or serverless function. Bundle the required fonts and WebAssembly assets. Microsoft Word and LibreOffice are not required.
Deploy DOCX to PDF on Vercel ↗A TypeScript library powered by our DOCX layout engine. Convert Word documents in Node.js or Next.js and get PDF bytes, a page count, and font diagnostics.
import { readFile, writeFile } from 'node:fs/promises';
import { exportPdf } from '@docx-editor.dev/docx-to-pdf';
const source = await readFile('document.docx');
const result = await exportPdf(source, {
fidelityPolicy: 'strict',
displayMode: 'proposed',
comments: true,
});
await writeFile('document.pdf', result.bytes);
console.log(result.pageCount, result.fontResolution);Install with npm install @docx-editor.dev/docx-to-pdf. Set up the library ↗
Process DOCX files in a Node.js application or serverless function. Bundle the required fonts and WebAssembly assets. Microsoft Word and LibreOffice are not required.
Deploy DOCX to PDF on Vercel ↗Supply the fonts your documents use and inspect the font report. Strict mode rejects known unsupported or approximate output. Best-effort mode returns the PDF with diagnostics.
Configure fonts and fidelity ↗Our DOCX engine calculates pages and positions text before writing the PDF. It is the same engine that powers DOCX Editor ↗, with searchable text, tables, headers, footers, and images.
result.bytesWrite PDF bytes to a file, return them from your application, or store them in your own infrastructure.
Convert a document ↗result.fontResolutionCheck the fonts used in the output and review diagnostics before delivering the document.
Work with fonts ↗displayModeChoose original, proposed, or marked-up text. Preserve comments as native PDF annotations.
Configure output ↗Open a DOCX in the converter above. The PDF is generated automatically. Review the result and select Download PDF. After editing, select Regenerate PDF to update the output.
The demo sends your document to this site’s server for conversion. Documents and generated PDFs are held in memory for the request. To process documents on your own machine, run the local demo.
DOCX to PDF uses the EigenPal Pro License. Internal, non-production evaluation is permitted. Production use requires a commercial agreement. Install the package from npm.
Use a Node.js runtime and include the required font and WebAssembly files in the function bundle. Check memory, duration, and file-size limits for your workload. The Next.js Edge runtime is not supported.
The engine calculates pages before PDF export. Fonts and unsupported content can affect the result. Compare your documents against PDFs exported from Word. The demo uses best-effort conversion and shows diagnostics for known differences. Library calls default to strict mode.
The converter accepts .docx files. Save a legacy .doc file as .docx in Word or another compatible editor before converting it.