GET STARTED

Convert your first DOCX to PDF

Run the local demo, evaluate your documents, and use the Node.js converter in your application.

DOCX to PDF is a Node.js library for converting Word documents inside your application. It uses the DOCX Editor layout engine to calculate pages and writes searchable PDF text from positioned glyphs.

Install the package

Use Node.js 22 and install the PDF package from npm:

npm install @docx-editor.dev/docx-to-pdf

The package includes the converter and its fallback font assets. npm installs its Core peer dependency. Keep packages from @docx-editor.dev on compatible versions.

The EigenPal Pro License covers internal, non-production evaluation. Production use requires a commercial agreement. Contact EigenPal for production licensing.

Run the local demo

Install Git, Node.js 22, and Bun. The demo starts a Node.js server, so Bun alone is not sufficient. Then clone the repository and start the PDF example:

git clone https://github.com/eigenpal/docx-editor.git
cd docx-editor
bun install
bun run dev:pdf

Open http://127.0.0.1:5180. Select Open DOCX and choose a document. The PDF is generated automatically. Review the preview and use Download PDF to save it. After editing the document, select Regenerate PDF to update the output.

The local demo sends the document to a Node.js server on your machine. The PDF exporter does not run in the browser. The demo processes uploads and generated PDFs in memory for the request.

The demo uses best-effort conversion. Expand its diagnostics to see unsupported content or font substitutions. Library calls default to strict conversion.

Use the online demo

Open the converter and select Open DOCX. The PDF is generated automatically after the document loads. You can edit the document and regenerate the PDF before downloading it.

The online demo accepts DOCX files up to 4 MiB and PDFs up to 3 MiB. It sends document bytes to this site's Node.js server. It uses best-effort conversion and shows diagnostics with the result. Documents and PDFs are held in memory for the request. Run the local demo to keep conversion on your own machine.

Evaluate your own documents

Use representative documents from your application: short letters, long agreements, tables that cross pages, and documents containing your actual fonts. Compare each result with a PDF exported from desktop Word using the same source document and fonts.

Check page count, line breaks, table boundaries, headers, footers, and text selection. Inspect every diagnostic. A successful strict export means no known unsupported or approximate output was reported; it does not prove that the PDF matches Word page for page.

Integrate the exporter

Use the Node.js guide to convert bytes and handle errors. Read the fonts guide before relying on pagination. For Next.js and Vercel, continue with the Next.js DOCX to PDF guide.