Adding raw html to template using jsreport-core (jsreport.render)



  • Hello, i would like to add raw html eg. <div style='color: red'>Hello world</div>
    in the template.

    in other words, i would like to access the template at some point, using document.getElementById('idString').innerHtml = "<div style='color: red'>Hello world</div>"
    and have it downloaded with the pdf template.

    But of course i cannot access the DOM since its a server side rendering.
    I would like some guidance to reach a similar behavior.

    Thanks in advance.


  • administrators

    hi! why don't you just put the script document.getElementById('idString').innerHtml = "<div style='color: red'>Hello world</div>" in the same template source? templates support js evaluation when using phantom, electron or chrome recipe for pdf, any limitation that you found that don't let you use normal js in your template?


Log in to reply
 

Looks like your connection to jsreport forum was lost, please wait while we try to reconnect.