@tiptap-pro/extension-export-pdf Changelog
Changelog for @tiptap-pro/extension-export-pdf
0.5.0
Minor Changes
-
9ee712b: Add
headerandfooterproperties to thepageMarginsoption, controlling the distance from the page edge to the header/footer. When the Pages extension is configured, these values are auto-derived fromheaderTopMarginandfooterBottomMargin; caller-provided values always take precedence.For
extension-export-pdf,extension-export-doc, andextension-export-odt, full end-to-end support requires the Tiptap convert service to be on a version that accepts the newpageMargins.header/footerfields and ships an updated@tiptap-pro/extension-export-docx.
0.4.2
Patch Changes
-
db8faf4: Fix:
ExportPdf'sheadersandfootersare now correctly applied to the exported PDF. Previously they were silently dropped whenever@tiptap-pro/extension-export-docxwas installed (DOCX-first path) and could crash the docx serializer when a non-Header/Footervalue was passed.Each slot (
default,first,even) now accepts any of:- a plain string — rendered as plain text (matches the existing server-side contract)
- a stringified Tiptap
JSONContent— parsed and converted - a Tiptap
JSONContentobject — converted viaconvertHeader/convertFooter - a
docxHeader/Footerinstance — passed through unchanged - an async factory returning a
Header/Footer— passed through unchanged
Example:
ExportPdf.configure({ headers: { default: "Tiptap GmbH" }, footers: { default: { type: "doc", content: [ { type: "paragraph", content: [{ type: "text", text: "Made with heart" }], }, ], }, }, });Tiptap
JSONContentnodes at a slot must include atypefield (the runtime discriminator againstdocxinstances). Invalid objects — missingtypeand not aHeader/Footerinstance — are now dropped with aconsole.warnnaming the offending value instead of being forwarded to the DOCX serializer where they would have crashed.The JSON fallback path (used when
@tiptap-pro/extension-export-docxisn't installed) additionally sanitizes headers/footers before serializing the request:Docx.Header/Docx.Footerinstances and async factories can't be JSON-serialized, so they're dropped per slot with aconsole.warnincluding the slot path (e.g.headers.first was ignored). Strings and Tiptap JSONContent nodes flow through untouched, so partial configs keep working.Added
onExportError?: (error: Error) => voidto the extension options and per-command overrides. It's invoked whenever the export pipeline rejects (failed dynamic import, failed DOCX conversion, network error, non-OK response) — previously those errors surfaced only as unhandled promise rejections. When no handler is configured, the extension falls back toconsole.errorso failures stay visible in devtools.Also fixes a
RangeError: Applying a mismatched transactionthat could surface when calling.chain().exportPdf(...).run()— the command is now synchronous at the Tiptap runner level (matchingexportDocx), with async work delivering results viaonCompleteExport.
0.4.1
Patch Changes
- 0608c46: Minor bugfixes & improvements
0.4.0
Minor Changes
- a845de6: Custom node conversion is now supported for PDF, DOC, ODT, and EPUB exports. To automatically opt-in to this feature the
ExportDocxextension needs to be present in your editor extensions configuration, otherwise thecustomNodesconfiguration will be ignored as it relies on theExportDocxconversion service.
0.3.0
Minor Changes
- fcd13d5: Initial beta point for export and pages packages