diff options
author | Hakim El Hattab <hakim.elhattab@gmail.com> | 2017-01-24 14:48:36 +0100 |
---|---|---|
committer | Hakim El Hattab <hakim.elhattab@gmail.com> | 2017-01-24 15:29:27 +0100 |
commit | 286b69b61f64bf47dd3ea710175aeb4de8288d9f (patch) | |
tree | 2af6f4813c19bcc5ba213b931857ad2946a50678 /js/reveal.js | |
parent | 568c7516f7ff7da7824db033946619d2c7ad761f (diff) | |
download | fosdem-2018-presentation-286b69b61f64bf47dd3ea710175aeb4de8288d9f.tar fosdem-2018-presentation-286b69b61f64bf47dd3ea710175aeb4de8288d9f.tar.gz |
fix empty pages in pdf exports (closes #1804)
Diffstat (limited to 'js/reveal.js')
-rw-r--r-- | js/reveal.js | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/js/reveal.js b/js/reveal.js index c1c4eca..8b00420 100644 --- a/js/reveal.js +++ b/js/reveal.js @@ -598,7 +598,7 @@ // Dimensions of the PDF pages var pageWidth = Math.floor( slideSize.width * ( 1 + config.margin ) ), - pageHeight = Math.floor( slideSize.height * ( 1 + config.margin ) ); + pageHeight = Math.floor( slideSize.height * ( 1 + config.margin ) ); // Dimensions of slides within the pages var slideWidth = slideSize.width, @@ -652,7 +652,12 @@ // so that no page ever flows onto another var page = document.createElement( 'div' ); page.className = 'pdf-page'; - page.style.height = ( pageHeight * numberOfPages ) + 'px'; + + // Reduce total height by 1px so that the page ends before + // the page, otherwise the page's 'page-break-after' will + // land on the wrong page + page.style.height = ( ( pageHeight * numberOfPages ) - 1 ) + 'px'; + slide.parentNode.insertBefore( page, slide ); page.appendChild( slide ); |