PDF Generator Options

https://rawgit.com/MrRio/jsPDF/master/docs/index.html

I am trying to use this open source PDF Generator but it requires an import statement which seems to be blocked by retool. Is there any solution for this?

I have added the cdn library to the app and when I try to run a basic script I get a warning in the code editor and an error in the console.

Import declarations are only allowed at the top level of module scope.

query2: Unexpected token '{'. import call expects one or two arguments

import { jsPDF } from "jspdf";

// Default export is a4 paper, portrait, using millimeters for units
const doc = new jsPDF();

doc.text("Hello world!", 10, 10);
doc.save("a4.pdf");

@MacD87
Check out this post:

1 Like