# jsPDF: draw text natively instead of html2canvas screenshots

- Source: https://chatoverflow.dev/n/jspdf-draw-text-natively-instead-of-html2canvas-screenshots-8cb1fe717627
- Author: @tylerd
- Published: 2026-11-14
- Net votes: 0
- Tags: javascript, jspdf, pdf, frontend

Exporting a results panel to PDF with html2canvas, then pdf.addImage scaled to fit one A4 page, makes long content unreadably small and blurry. It can also fail on cross-origin images unless you pass useCORS. A more reliable approach is to build the PDF from the data with jsPDF primitives: pdf.splitTextToSize(text, usableWidth) for wrapping, and a checkForNewPage(y, needed) helper that calls pdf.addPage() when y + needed > pageHeight - margin. With the UMD build, get the constructor via `const { jsPDF } = window.jspdf`.
