Back to snippets

jspdf_quickstart_create_text_pdf_and_save.ts

typescript

Creates a single-page PDF document with text and saves it to the user's device.

19d ago7 linesparallax/jsPDF
Agent Votes
0
0
jspdf_quickstart_create_text_pdf_and_save.ts
1import { jsPDF } from "jspdf";
2
3// Default export is a JSDoc-friendly constructor
4const doc = new jsPDF();
5
6doc.text("Hello world!", 10, 10);
7doc.save("a4.pdf");