@paperjsx/json-to-docx-pro 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,7 @@
1
+ Copyright (c) 2026 Plainworks Inc. All rights reserved.
2
+
3
+ This software is proprietary and confidential. Unauthorized copying, distribution,
4
+ modification, or use of this software, via any medium, is strictly prohibited.
5
+
6
+ A valid PaperJSX Pro license key is required to use this software.
7
+ See https://paperjsx.com/pricing for licensing options.
package/README.md ADDED
@@ -0,0 +1,60 @@
1
+ # PaperJSX DOCX Pro
2
+
3
+ Generate production Word `.docx` files from JSON and TypeScript with the paid PaperJSX DOCX engine.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ npm install @paperjsx/json-to-docx-pro
9
+ ```
10
+
11
+ Requires Node.js `>=18` and a valid `PAPERJSX_LICENSE_KEY`.
12
+
13
+ ## Quick Start
14
+
15
+ ```ts
16
+ import { renderToDocx } from "@paperjsx/json-to-docx-pro";
17
+ import { writeFileSync } from "node:fs";
18
+
19
+ const result = await renderToDocx(
20
+ {
21
+ type: "DocxDocument",
22
+ pageSize: "a4",
23
+ pages: [
24
+ {
25
+ elements: [
26
+ { type: "heading", level: 1, text: "Enterprise Contract" },
27
+ { type: "paragraph", text: "This agreement is effective immediately." },
28
+ ],
29
+ },
30
+ ],
31
+ },
32
+ { licenseKey: process.env.PAPERJSX_LICENSE_KEY },
33
+ );
34
+
35
+ writeFileSync("contract.docx", result.buffer);
36
+ ```
37
+
38
+ ## Included In Pro
39
+
40
+ - production/self-hosted commercial DOCX usage
41
+ - advanced pagination and paid rendering features
42
+ - tracked changes and compare flows
43
+ - template hydration and broader document workflows
44
+
45
+ ## Core API
46
+
47
+ - `renderToDocx(input, options?)`
48
+ - `renderToPdf(input, options?)`
49
+ - `hydrateDocx(templateBuffer, data, options?)`
50
+ - `renderWithTrackedChanges(original, revised, options?)`
51
+ - `compareDocuments(originalBuffer, revisedBuffer, options?)`
52
+
53
+ ## Links
54
+
55
+ - Docs: [paperjsx.com/docs](https://paperjsx.com/docs)
56
+ - Pricing: [paperjsx.com/pricing](https://paperjsx.com/pricing)
57
+
58
+ ## License
59
+
60
+ Commercial license required. See the packaged `LICENSE` file.
@@ -0,0 +1,63 @@
1
+ /**
2
+ * @paperjsx/json-to-docx
3
+ *
4
+ * JSON-first DOCX rendering engine.
5
+ * DocxDocument JSON in, .docx binary out.
6
+ *
7
+ * No React. No DOM. No Puppeteer. No browser.
8
+ *
9
+ * @example
10
+ * ```ts
11
+ * import { renderToDocx } from '@paperjsx/json-to-docx';
12
+ *
13
+ * const result = await renderToDocx({
14
+ * type: 'DocxDocument',
15
+ * pageSize: 'a4',
16
+ * pages: [{
17
+ * elements: [
18
+ * { type: 'heading', level: 1, text: 'Hello World' },
19
+ * { type: 'paragraph', text: 'Generated by an AI agent.' },
20
+ * ]
21
+ * }]
22
+ * });
23
+ *
24
+ * fs.writeFileSync('output.docx', result.buffer);
25
+ * ```
26
+ */
27
+ type DocxPvce = Record<string, unknown> & {
28
+ compileChart: (...args: unknown[]) => unknown;
29
+ chartToSVG: (...args: unknown[]) => unknown;
30
+ };
31
+ export { renderToDocx, renderToDocxWithQuality, renderToPdf, hydrateDocxToPdf, renderWithTrackedChanges, renderHtmlToDocx, hydrateDocx, validateDocxDocument, } from './render.js';
32
+ export type { FindingCode, QualityFinding, QualityReport, QualityVerdict, RenderWithQualityResult, RepairEntry, RepairRisk, } from '@paperjsx/license';
33
+ export { diffDocxDocuments } from './diff/document-diff.js';
34
+ export { compareDocuments } from './diff/compare-documents.js';
35
+ export type { Change, ChangeSet, DiffOptions } from './diff/document-diff.js';
36
+ export type { CompareDocumentsOptions, CompareDocumentsResult, } from './diff/compare-documents.js';
37
+ export { DocxDocumentSchema, DocxElementSchema, TextRunSchema, CommentInfoSchema, HeadingElementSchema, ParagraphElementSchema, ListElementSchema, TableElementSchema, ImageElementSchema, ChartElementSchema, ShapeElementSchema, CodeBlockElementSchema, PageBreakElementSchema, DividerElementSchema, DocxPageSchema, DocxThemeSchema, DocxTemplateSchema, HeaderFooterDefSchema, BaseStyleSchema, BorderStyleSchema, SpacingSchema, ColorValue, RevisionInfoSchema, type DocxDocument, type DocxElement, type DocxPage, type DocxTheme, type DocxTextRun, type DocxRevisionInfo, type HeaderFooterDef, TableOfContentsSchema, HtmlDocxOptionsSchema, type HtmlDocxOptions, } from './schema.js';
38
+ export type { DocxResult, PdfResult, RenderStats, DocxWarning, RenderOptions, RevisionInfo, TextRunRevision, TextRunStyleSnapshot, RenderProgress, ValidationResult, ValidationIssue, HydrationOptions, ImageAdapter, ChartAdapter, ChartRenderInput, TableOfContentsConfig, StructuredDocument, StructuredPage, StructuredElement, DocumentMetadata, PageDimensions, ElementType, BaseElement, HeadingElement, ParagraphElement, TextRunElement, TableElement, ImageElement, ChartElement, ShapeElement, ListElement, ContainerElement, TableColumn, TableRow, TableCell, CellReference, CellStyle, TextRun, CommentInfo, ComputedStyle, BoundingBox, BorderStyle, FillStyle, GradientDefinition, GradientStop, StrokeStyle, ExtractedLayoutInfo, DOCXHints, SectionBreak, HeaderFooterContent, Background, AssetRegistry, StyleDefinitions, ExtractionStats, ChartType, ChartSeries, ShapeType, ListItem, LegendConfig, AxesConfig, AxisConfig, } from './types.js';
39
+ export { DOCXError, DOCXErrorCode, DOCXWarningCode, Errors, Warnings, WarningCollector, isDOCXError, toDOCXError, createWarning, formatWarning, } from './errors.js';
40
+ export { serializeStructuredToNativeOOXML, type NativeOOXMLSerializerOptions, type NativeOOXMLSerializerResult, } from './ooxml/native-serializer.js';
41
+ export { docxToStructured } from './adapters/docx-to-structured.js';
42
+ export { paperToStructured } from './adapters/paper-to-structured.js';
43
+ export { convertHtmlToStructured } from './adapters/html-to-structured.js';
44
+ export type { HtmlConversionOptions } from './adapters/html-to-structured.js';
45
+ export type { PaperDocumentInput } from './adapters/paper-types.js';
46
+ export { pxToTwips, pointsToHalfPoints, inchesToTwips, inchesToEmu, pxToEmu, mmToTwips, lineHeightToDocx, PAGE_SIZES, pxToHalfPoints, } from './utils/units.js';
47
+ export { isCodeBlock, detectImageAlignment, isMonospaceFont, } from './utils/detection.js';
48
+ export { getThemePreset, getDefaultTheme, CORPORATE_THEME, MODERN_THEME, ACADEMIC_THEME, CLASSIC_THEME, MINIMAL_THEME, DARK_THEME, type Theme, type ThemePresetName, } from './themes/presets.js';
49
+ export { hydrateTemplate, } from './hydration/hydrator.js';
50
+ export { scanForPlaceholders, } from './hydration/placeholder-scanner.js';
51
+ export { batchRender, batchHydrate } from './batch.js';
52
+ export { BatchOptionsSchema } from './schema.js';
53
+ export type { BatchOptions, BatchResult, BatchItemResult } from './types.js';
54
+ declare const pvce: DocxPvce;
55
+ export { pvce };
56
+ export * as core from './core/index.js';
57
+ export * as visualPolish from './visual-polish/index.js';
58
+ export { SecurePDF } from './secure/index.js';
59
+ export { validateAccessibility, remediateAccessibility } from './accessibility/index.js';
60
+ export type { AccessibilityReport, AccessibilityViolation, AccessibilityLevel, DocxAccessibilityViolationCode, } from './accessibility/types.js';
61
+ export type { AccessibilityRemediationResult } from './accessibility/remediator.js';
62
+ export { IndiaGSTQRSchema, EUReverseChargeSchema, BrazilianDanfeSchema, validateIndiaGSTQR, validateEUReverseCharge, validateBrazilianDanfe, } from './compliance/index.js';
63
+ //# sourceMappingURL=index.d.ts.map