@tiptap-pro/extension-export-pdf Changelog

Changelog for @tiptap-pro/extension-export-pdf

0.5.0

Minor Changes

  • 9ee712b: Add header and footer properties to the pageMargins option, controlling the distance from the page edge to the header/footer. When the Pages extension is configured, these values are auto-derived from headerTopMargin and footerBottomMargin; caller-provided values always take precedence.

    For extension-export-pdf, extension-export-doc, and extension-export-odt, full end-to-end support requires the Tiptap convert service to be on a version that accepts the new pageMargins.header/footer fields and ships an updated @tiptap-pro/extension-export-docx.

0.4.2

Patch Changes

  • db8faf4: Fix: ExportPdf's headers and footers are now correctly applied to the exported PDF. Previously they were silently dropped whenever @tiptap-pro/extension-export-docx was installed (DOCX-first path) and could crash the docx serializer when a non-Header/Footer value 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 JSONContent object — converted via convertHeader / convertFooter
    • a docx Header / Footer instance — 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 JSONContent nodes at a slot must include a type field (the runtime discriminator against docx instances). Invalid objects — missing type and not a Header / Footer instance — are now dropped with a console.warn naming 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-docx isn't installed) additionally sanitizes headers/footers before serializing the request: Docx.Header / Docx.Footer instances and async factories can't be JSON-serialized, so they're dropped per slot with a console.warn including 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) => void to 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 to console.error so failures stay visible in devtools.

    Also fixes a RangeError: Applying a mismatched transaction that could surface when calling .chain().exportPdf(...).run() — the command is now synchronous at the Tiptap runner level (matching exportDocx), with async work delivering results via onCompleteExport.

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 ExportDocx extension needs to be present in your editor extensions configuration, otherwise the customNodes configuration will be ignored as it relies on the ExportDocx conversion service.

0.3.0

Minor Changes

  • fcd13d5: Initial beta point for export and pages packages