@paperjsx/json-to-docx
v0.5.6
Published
Generate Word documents from JSON
Maintainers
Readme
PaperJSX DOCX Pro
Generate production Word .docx files from JSON and TypeScript with the paid PaperJSX DOCX engine.
Install
npm install @paperjsx/json-to-docx-proRequires Node.js >=18 and a valid PAPERJSX_LICENSE_KEY.
Quick Start
import { renderToDocx } from "@paperjsx/json-to-docx-pro";
import { writeFileSync } from "node:fs";
const result = await renderToDocx(
{
type: "DocxDocument",
pageSize: "a4",
pages: [
{
elements: [
{ type: "heading", level: 1, text: "Enterprise Contract" },
{ type: "paragraph", text: "This agreement is effective immediately." },
],
},
],
},
{ licenseKey: process.env.PAPERJSX_LICENSE_KEY },
);
writeFileSync("contract.docx", result.buffer);Included In Pro
- production/self-hosted commercial DOCX usage
- advanced pagination and paid rendering features
- tracked changes and compare flows
- template hydration and broader document workflows
Core API
renderToDocx(input, options?)renderToPdf(input, options?)hydrateDocx(templateBuffer, data, options?)renderWithTrackedChanges(original, revised, options?)compareDocuments(originalBuffer, revisedBuffer, options?)
Links
- Docs: paperjsx.com/docs
- Pricing: paperjsx.com/pricing
License
Commercial license required. See the packaged LICENSE file.
