Phase 5 - Media and typography reliability
S
Saurabh Choudhary
This phase focuses on reliable fonts, charts, SVGs and images in exported PDFs while retaining explicit quality controls and predictable cleanup.
### Planned work
- Improve font readiness
- Wait for required fonts through the Font Loading API before measuring and rendering.
- Add a custom TTF/OTF font registry for selectable-text output, documenting supported font formats and limitations.
- Capture charts consistently
- Freeze/snapshot chart canvases for export.
- Keep export replacements isolated and restore temporary resources after success, failure or cancellation.
- Define SVG rendering behavior
- Define when to preserve SVG content and when to rasterize it.
- Document fidelity differences and fallback behavior across renderers.
- Optimize image processing
- Add automatic image optimization with explicit image-quality controls.
- Extend and verify repeated-image caching to avoid redundant work.
- Reuse repeated document assets
- Extend repeated-watermark caching.
- Expose or refine static-footer reuse metrics.
- Build on existing reuse paths rather than duplicating them.
- Verify reliability and recovery
- Document CORS failures and recovery paths.
- Confirm all staging replacements are restored.
- Cover representative fonts, images, charts and SVGs with focused regression tests and browser verification.
### Primary goals
- Reduce missing fonts, images and charts in exported documents.
- Make typography and media behavior predictable across supported render modes.
- Reduce repeated asset processing without silently sacrificing quality.
- Preserve backward compatibility and reliable cleanup.
### Completion criteria
CORS failure behavior is documented, all staging replacements are restored, and image-quality controls are explicit. Feature-specific regression and browser results are recorded before marking the phase complete.
Status: Planned
S
Saurabh Choudhary
Released in
vue-pdf-export 1.3.0
: Phase 5 adds font readiness and optional TTF/TrueType-outline OTF registration for selectable-text PDFs; export-only chart snapshots and defined SVG fallbacks; opt-in image optimization with explicit quality settings; and per-export reuse for repeated images, image watermarks and static footers. Temporary font/media resources are cleaned after success, failure or cancellation, with CORS recovery guidance.Text watermarks now draw reusable
PDF vector outlines
instead of native PDF text, so the mark is not selectable or copyable as PDF text. A matching registered custom font supplies its glyphs; otherwise a bundled Arimo face is used. Visible letters may still be recognized by OCR. Image and trusted HTML watermarks keep their image path.The release also adds watermark design presets, a foreground default layer, PDF-visible chart labels/callouts, and playground controls. Existing option names remain supported. If you relied on an omitted layer meaning background, set
layer: 'background'
explicitly. Browser hover tooltips cannot remain interactive in a static PDF, and Canvas/selectable-text renderers have different SVG and font limits.Install:
npm install vue-pdf-export@1.3.0
. npm package and README.S
Saurabh Choudhary
Phase 5 media and typography reliability is implemented in the current source and is undergoing final release validation.
This update adds:
- Font readiness before layout, plus optional TTF and TrueType-outline OTF registration for selectable-text PDFs. Without a custom font, the document keeps its existing CSS font behavior.
- Export-only snapshots for chart canvases and defined SVG behavior: Canvas preserves SVG in its staging DOM, while selectable-text output rasterizes unsupported SVG shapes.
- Opt-in image optimization with explicit DPI, JPEG quality, transparency and repeated-image cache controls. Existing image quality is not changed when optimization is off.
- Per-export reuse for repeated image watermarks and static footer assets, with opt-in media counters in generation metrics.
- CORS recovery guidance and cleanup of temporary staging content and font registrations after success, failure or cancellation.
- Optional watermark design presets, trusted HTML stamps and faint page images. Numeric chart labels and fixed callouts can appear in PDFs; live hover tooltips cannot remain interactive in a static PDF.
The full unit suite, TypeScript checks and library/playground builds have passed. Representative Phase 5 exports passed in Chromium and WebKit, and selected pages were visually inspected. Firefox could not be verified on the local headless graphics setup. The latest format/orientation matrix also passed 82 named combinations; that does not promise identical rendering for arbitrary HTML/CSS.
Existing props remain available. One intentional default change needs attention: a watermark without
layer
now uses foreground
; set layer: 'background'
explicitly if your document relies on that placement. Custom font embedding has the format limits above. The next package version is not published yet
; I will post its version and release link after publication and final acceptance.