diff options
author | Hakim El Hattab <hakim.elhattab@gmail.com> | 2017-04-04 14:02:54 +0200 |
---|---|---|
committer | Hakim El Hattab <hakim.elhattab@gmail.com> | 2017-04-04 14:02:54 +0200 |
commit | c3e96f1f0e37b9f5d8052bcee6db100606c3e458 (patch) | |
tree | a7ba8713c27ddd2fa38dfa4ff4aebcce10efbe20 | |
parent | 2584a6d97090f8987f49ec3aa5abcbdf8b0d1b8e (diff) | |
download | fosdem-2018-presentation-c3e96f1f0e37b9f5d8052bcee6db100606c3e458.tar fosdem-2018-presentation-c3e96f1f0e37b9f5d8052bcee6db100606c3e458.tar.gz |
make pdf page height offset configurable
-rw-r--r-- | js/reveal.js | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/js/reveal.js b/js/reveal.js index dd015bc..b3a634b 100644 --- a/js/reveal.js +++ b/js/reveal.js @@ -166,6 +166,13 @@ // to PDF, unlimited by default pdfMaxPagesPerSlide: Number.POSITIVE_INFINITY, + // Offset used to reduce the height of content within exported PDF pages. + // This exists to account for environment differences based on how you + // print to PDF. CLI printing options, like phantomjs and wkpdf, can end + // on precisely the total height of the document whereas in-browser + // printing has to end one pixel before. + pdfPageHeightOffset: -1, + // Number of slides away from the current that are visible viewDistance: 3, @@ -664,15 +671,7 @@ // so that no page ever flows onto another var page = document.createElement( 'div' ); page.className = 'pdf-page'; - - // Set the total height of the PDF page container. - // - // This is offset by -1 to ensure that the page ends and - // breaks within the document/paper height. Ending exactly - // on the document height breaks in-browser printing, but - // works in CLI printing (phantomjs, wkpdf etc]). - page.style.height = ( ( pageHeight - 1 ) * numberOfPages ) + 'px'; - + page.style.height = ( ( pageHeight + config.pdfPageHeightOffset ) * numberOfPages ) + 'px'; slide.parentNode.insertBefore( page, slide ); page.appendChild( slide ); |