Legacy API Migration Guide
July 14, 2026 ยท View on GitHub
This project has moved from the old html2canvas + jsPDF pipeline to the new
DOM snapshot + Worker + WASM pipeline. To reduce upgrade friction, the public
API is being aligned with legacy dompdf.js step by step.
This guide summarizes the current compatibility status.
Already aligned
These APIs are available and have working behavior in the current branch:
dompdf(root, options) -> Promise<Blob>fontConfigiconFontlangFontConfigencryptionpaginationpageConfigobject formpageConfig(pageNum, totalPages)function formexcludePage/excludePageson object-formpageConfigpageBreakattributedivisionDisableattributebackgroundColorcompressputOnlyUsedFontsonProgress
Signature-compatible with warnings
These options are accepted so old code does not fail at call time, but the new engine does not provide the old behavior yet. A runtime warning is emitted.
onJspdfReadyonJspdfFinishforeignObjectRenderingallowTaintproxyimageTimeoutloggingcachewindowWidthwindowHeightscrollXscrollYxywidthheightscalecanvasremoveContaineronclonepdfFileNamefloatPrecisionorientation
Requires migration
These usage patterns are tied to the old jsPDF/html2canvas architecture and
should be migrated to the new engine model:
- Direct mutation of a live
jsPDFinstance insideonJspdfReady - Final-pass edits inside
onJspdfFinish - Features that depend on html2canvas clone-stage hooks
- Proxy- or canvas-driven workflows specific to the old raster pipeline
Recommended upgrade path
- Upgrade first and keep old options in place.
- Watch runtime warnings to see which options are only signature-compatible.
- Replace old
jsPDF-specific customization with current export hooks or post-processing code around the generatedBlob/ bytes. - Use
onProgressfor export lifecycle feedback such as DOM collection, total page counting, and current render page. - Prefer
fontConfig/langFontConfigfor multilingual text and keep object-formpageConfigfor common header/footer cases.
Notes
- The new engine generates vector-first PDFs instead of canvas-based image PDFs.
- Some old option names still exist only to avoid breaking upgrades.
onProgressis the new, working export callback and is separate from the legacy no-oponJspdfReady/onJspdfFinishcompatibility hooks.- This document should be updated whenever compatibility status changes.