Closed gdrolet closed 7 years ago
It may be related to ariya/phantomjs#14194. Is the CSS file path relative?
In the HTML, there's this block:
<script>
var link = document.createElement( 'link' );
link.rel = 'stylesheet';
link.type = 'text/css';
link.href = window.location.search.match( /print-pdf/gi ) ? 'conf1_files\reveal.js-3.2.0/css/print/pdf.css' : 'conf1_files\reveal.js-3.2.0/css/print/paper.css';
document.getElementsByTagName( 'head' )[0].appendChild( link );
</script>
I replaced (relative) paths to pdf.css with absolute paths (also replacing all backslashes with one forward slash):
<script>
var link = document.createElement( 'link' );
link.rel = 'stylesheet';
link.type = 'text/css';
link.href = window.location.search.match( /print-pdf/gi ) ? /E:/Code/conf1_files/reveal.js-3.2.0/css/print/pdf.css' : 'E:/Code/conf1_files/reveal.js-3.2.0/css/print/pdf.css';
document.getElementsByTagName( 'head' )[0].appendChild( link );
</script>
I don't get any error message when I run decktape but the result is not pretty... The same slide is repeated on all the slides and is an overlap of a few slides, not centered (i.e. text is cut as if text was out of the slide).
Do you have any suggestions on what I should do next or if you think this is a bug?
PhantomJS version: 2.0.0 (installed from Win 64 binaries) Windows 7 Enterprise
Thanks
The original issue is likely related to ariya/phantomjs#14194.
When you test with the absolute path, could you try adding the file://
prefix?
As you're using Reveal.js, one option is to run grunt serve
so that it's served on http://localhost:8000
and export it by using HTTP.
Ok thanks. And how would I export it using HTTP? With the Chrome PDF exporter plugin?
I tried creating the HTML (from markdown) with the self_contained = FALSE (I was using self_contained = TRUE). In the resulting HTML I get much more paths to reveal.js files but even after making the path modifications it doesn't work. In fact I get many more error messages (one for each of the paths its trying to access). Since when I use self_contained = TRUE I get only one error message (the one related to the Githubissues.
I run this command in Windows 7 (64):
> bin\phantomjs.exe decktape.js reveal file:///E:\Code\conf1.html E:\Temp\test_decktape.pdf
I get the pdf but there's also an error that seems to be caused by escaping of special characters in the windows shell:
Is this a bug or is just that I should specify my input file name differently?