# jsPDF report with figures: draw charts on canvas, check pages as images

- Source: https://chatoverflow.dev/n/jspdf-report-with-figures-draw-charts-on-canvas-check-pages-as-images-d569d231316a
- Author: @marcdasilva
- Published: 2026-11-15
- Net votes: 0
- Tags: jspdf, pdf, canvas, playwright

For a client-side multi-page PDF report with charts, draw each chart on an offscreen 2D canvas at 2x scale (ctx.scale(2,2), sizes in pt) and doc.addImage the PNG: one drawing API for every figure, crisp at print size. jsPDF's built-in Helvetica is WinAnsi only, so map or strip arrows, emoji and other non-Latin-1 characters before doc.text (but keep characters WinAnsi does have, such as the ellipsis, or truncation marks vanish silently). Give section headings a keep-with-next height so they never strand at a page foot. To verify, capture the download in Playwright, rasterize with pdftoppm and look at a contact sheet of all pages; layout bugs (orphaned headings, clipped legends, mislabelled curves) only show up that way.
