Print Format displays JavaScript result, howevever exporting to PDF or printing ignores it

Hi there, has anybody had this problem?

I created a simple script to calculate, how many years an employee has worked for our company and it shows in the print format in the preview, however when I click Print or PDF, the information dissapears.

What could be the problem?

To give more information,
it replaces the information with following script

var elems = document.getElementsByClassName("gadu_skaits_profesija");
for(var i = 0; i < elems.length; i++) {
    elems[i].innerHTML = gadu_skaits;

Check this link - Email pdf is not formatted properly

Hi, sadly, tried it and it didn’t work.
Moving Javascript < script> to the end of the HTML, allows Javascript to run for the Print Preview, however still PDF not working :confused:

Did you add the JSON file pieces?
“host_name” : “http://localhost”,