Hi everyone,
I’m wondering if anybody has a way of calling javascript functions whilst using PDFRenderer? At the moment I’m calling my javascript functions in the form_show event. The function just updates the html elements, react style. However, when converting the html page to pdf, the script never gets called. Has anybody encountered this before? Thanks!
I think the issue here is that form_show isn’t called by PDFRenderer.
What if you have an argument you pass into the form init to call the form_show method.
so
def __init__(pdf=False):
if pdf:
self.form_show()
Thanks for the suggestion, that’s lightning fast! I tried adding the pdf argument, but the js function is still not being called, probably something to do with the init method running before the form is added to the page. I wonder if it’s better to just use an external js library instead?
1 Like
No problem, just caught me looking at the forum at the right time.
It’s hard to say without a clone or code to look at, but that could solution!
Just an update - I found a workaround for this, although the method is a bit finnicky. I store the whole custom html/css data in tables, and in server code just construct whatever modification is required to parts of the custom html. This dynamic part is then passed as an argument to the form, and the .html property of the form is set in the init method of the form.
As I said, the method above is a very long workaround but it works for now. Open to using other methods if anyone can find any!