StaticpackExports a document to the specified output format.
The document to export
The output format type (e.g., "nodebuffer", "blob", "string")
Optionalprettify: boolean | "" | " " | " " | "\t"Whether to prettify the XML output (boolean or PrettifyType)
Optional array of file overrides for custom XML content
A promise resolving to the exported document in the specified format
StatictoExports a document to an ArrayBuffer.
The document to export
Optionalprettify: boolean | "" | " " | " " | "\t"Whether to prettify the XML output
Optional array of file overrides
A promise resolving to the document as an ArrayBuffer
StatictoExports a document to a base64-encoded string.
The document to export
Optionalprettify: boolean | "" | " " | " " | "\t"Whether to prettify the XML output
Optional array of file overrides
A promise resolving to the document as a base64 string
StatictoExports a document to a Blob (for browser environments).
The document to export
Optionalprettify: boolean | "" | " " | " " | "\t"Whether to prettify the XML output
Optional array of file overrides
A promise resolving to the document as a Blob
StatictoExports a document to a Node.js Buffer.
The document to export
Optionalprettify: boolean | "" | " " | " " | "\t"Whether to prettify the XML output
Optional array of file overrides
A promise resolving to the document as a Buffer
StatictoExports a document to a Node.js Stream.
The document to export
Optionalprettify: boolean | "" | " " | " " | "\t"Whether to prettify the XML output
Optional array of file overrides
A readable stream containing the document data
StatictoExports a document to a string representation.
The document to export
Optionalprettify: boolean | "" | " " | " " | "\t"Whether to prettify the XML output
Optional array of file overrides
A promise resolving to the document as a string
Exports documents to various output formats.
The Packer class provides static methods to convert a File object into different output formats such as Buffer, Blob, string, or stream. It handles the compilation of the document structure into OOXML format and compression into a .docx ZIP archive.
Public Api
Example