Scheduling PDF Creation

I have been able to get html2pdf.js - npm to create a PDF using onClick events.
The problem is that at HH:MM everyday I need to get this PDF email and/or saved to a third party.
I’d like this to happen automagically with no user interaction. I also use XANO, which does have a scheduler/crontab.

1a) What is the recommended way to get PDF created automatically at a scheduled time?
1b) Should be using html2pdf?
2a) Should I just do this in Xano and/or some other API service?
2b) Which API service do you think I should look at for this?

You are going to need to use a chron utility like Xano. If you are currently using Xano for your backend, then that makes sense to use it for this task also. WeWeb cannot schedule jobs like you are looking for.

1b. The documentation says that you can’t use html2pdf in a non-browser environment. If you want to create the pdf in Xano you need another library or an external service.

Thanks, I did not see this.

1 Like

@peteletkemansst How did you manage to get html2pdf to work by the way? I would really need this for my app but not sure where to start. Thanks in advance!

Hello @aeynaud,

You need to include the JS Library and publish the page.

I have this

var makepdf = document.getElementById("makepdf");

Where I have a div/control with an ID of makepdf.
As stated, this requires the client to press a button or do some action and cannot be scripted.

There are other tool/libraries which can be used.
I’ve found this to be a good one