maxm-jspdfexample.web.val.run
1
2
3
4
5
6
7
8
9
import { jsPDF } from "npm:jspdf";
export const helloWorldPDF = async (req: Request) => {
const doc = new jsPDF();
doc.text("Hello world!", 10, 10);
return new Response(doc.output(), {
headers: { "Content-Type": "application/pdf" },
});
};
Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
Comments
Nobody has commented on this val yet: be the first!
April 5, 2024