I never heard of wkhtmltopdf before, but I think I might be able to help.
(Edit 2: Thanks for the great bug description, I could easily reproduce the issue!)
I used some “modern” javascript features in rrdimg.js, which were introduced with ECMAScript 6 in 2015.
As far as I could find, wkhtmltopdf uses QtWebkit as the underlying web engine. Unfortunately, this engine seems to be outdated/unmaintained and does not support ES6:
So rrdimg.js should work fine in any modern browser and you don’t need to report a bug
To make this all work for you with wkhtmltopdf, you can use a javascript transpiler and convert rrdimg.js back to the ES5 standard (look for the !es2015 preset).
But I’m afraid you might also run into issues with jQuery and CSS.
Edit: On second thought, I think you can even ignore the error, if that’s possible. rrdimage.js doesn’t do anything necessary for the initial page content that you want to capture.
In a perfect world, yes. But there is no good system in the existing CGIs to add such scripts dynamically to the header. And I couldn’t think of an easy way to add one either.
All the javascript does by itself is search for graphs and attach events to the time range select buttons. Yes, this does waste a few milliseconds on each page load, but I don’t think anybody minds.
No worries! I enjoy discussing my work and I always learn something new along the way. I hope I could help!
Glad to hear! I assumed it was a wkhtmltopdf issue but I wanted to be sure.
I don’t want to be re-compiling the code. I’m going try a few more things with wkhtmltopdf. I know I can add a parameter to --disable-javascript and that gets rid of the error.
I may end up going back to the “manual” method.
For an overly complete back-up of my system I do a page print to PDF of most every IPFire WebGUI page. This is only done once a year but I have found it to be a lifesaver when all goes bad/ugly!