I am trying to use the pdf export option of reveal.js as documented in the repo readme.
I have the following problems:
No idea what I've done wrong or how to troubleshoot it. I'm using the latest version of reveal.js css etc from Github (sha: 131c00689a4c7a18e5c991fc8102347e4594b5d4) on this example file.
I'm using Google-chrome Version 34.0.1847.132 on Ubuntu 14.04
Remove
<link rel="stylesheet" media="print" href="reveal.js/css/print/pdf.css" />
Add
<!-- If the query includes 'print-pdf', include the PDF print sheet -->
<script>
if( window.location.search.match( /print-pdf/gi ) ) {
var link = document.createElement( 'link' );
link.rel = 'stylesheet';
link.type = 'text/css';
link.href = 'reveal.js/css/print/pdf.css';
document.getElementsByTagName( 'head' )[0].appendChild( link );
}
</script>
Add ?print-pdf
to the end of URL, e.g. change .../index.html#
to .../index.html?print-pdf#
I made a presentation using Slides and exported it in HTML, but for me the William Zhanf solution doesn't work at all. I had all the slides overlayed. This is how I solved:
pdf.css
from here and place it in the same folder with the html file.</body>
tag the William Zhanf snippet (with changed path to the css file):<script>
if( window.location.search.match( /print-pdf/gi ) ) {
var link = document.createElement( 'link' );
link.rel = 'stylesheet';
link.type = 'text/css';
link.href = 'pdf.css'; // Notice: I changed the path
document.getElementsByTagName( 'head' )[0].appendChild( link );
}
</script>
?print-pdf
to the end of URL and print as PDF from Chrome.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With