Generating PDF - NPM Plugin - jsPDF

Hello everybody!

I’m trying to export HTML to PDF and I’ve seen some topics on the subject in the community. This one is a more specific question about the NPM Plugin:

I’m trying to use jsPDF and on WeWeb it’s saying “not defined” error for the new jsPDF() code.

However, when using the same code in another tool (JSFiddle) the same code works normally.

JSFiddle PDF Export Example

This code can generate the PDF, but I can’t adapt it to work on the WebWeb. We can work to get it to work correctly…

The workaround I’m trying to do is create a blank page with the text that I want to save as a PDF and put to print. So I’m having success, but a direct PDF save would be more professional.

I would like to express my gratitude to the community for trying to help us with this challenge.

Best Regards,
Thanks in advance.

1 Like

What error are you getting? Can you share more about the context in which you are having challenges?

1 Like

Hi @raydeck !

I need to create an export from HTML to PDF according to the HTML tags (in WORD it works fine).

Using the NPM plugin I can install the necessary libraries (jsPDF) but the code that the library creator puts for us to use doesn’t work on the WeWeb and as I don’t have 100% programming knowledge, I’m missing some part that I don’t know.

The objective is for the code to take the value of the variable and export it to PDF.

To make progress, you need to show what you have and where the error is, rather thae describing it. I find that one can do this with

  1. copy-pasted text of code and response (the worst option, truth be told, since you don’t know what to copy-paste, and it leads to more iterations),
  2. screenshots,
  3. a recorded video (loom is a great resource for this) or
  4. bringing to live office hours. We do office hours on the hard part of low-code every day at State Change.
3 Likes