I find that the function saveTempContent is not correctly detecting the url paths correctly and hence not inserting the full url into the href.
In both pre-replace_callback functions the test for a '/' as the first character in the url does not imply an absolute path, in fact, koolreports is placing a '/' immediately before the path like this: <script type='text/javascript' src=/libraries/koolreport/src/clients/core/KoolReport.js'> and as a result the script is not loaded. I don't know if the script is actually required or not but it is certainly not if it is.
Of a more pressing issue is the CSS. When we add bootstrap css via the use statement the css is loaded via javascript and the KoolReport.load.resources. Now this may be correct, however, if the javascript is not loading then the css will not load.
So in order to get the CSS to load I inserted the link statements in the pdf view, but, again the preg_replace_callback fails to find and matches when the link tag is in the form: <link href="/libraries/koolreport/src/clients/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
It appears the preg_replace_callback will only match when the link tag is in this form: <link rel="stylesheet" type="text/css" href="/libraries/koolreport/src/clients/bootstrap/css/bootstrap.min.css" />
It seems the regex is expecting something between the link tag and the href.
For the moment I have commented out the isAbsolutePath test of substr($href, 0, 1) === "/", and I have ensured that my link tags are in the correct format and it seems to work.
I assume these worked in the past because chromeBinary and nodeBinary work with local executables and they do everything relative to the site root, but these will not work using any offsite pdf renering engine such as PhantomjsCloud.