aboutsummaryrefslogtreecommitdiff
path: root/js/reveal.js
diff options
context:
space:
mode:
authorHakim El Hattab <hakim.elhattab@gmail.com>2017-01-24 14:48:36 +0100
committerHakim El Hattab <hakim.elhattab@gmail.com>2017-01-24 14:48:36 +0100
commitd4133f0160f757af90649710769789631d4a93a0 (patch)
tree4e9bfad7f0326f0c86cb16ccc0766fed8cc302f8 /js/reveal.js
parenta6ecbfa73272977d04e107f878a6afbfd17c6869 (diff)
downloadfosdem-2018-presentation-d4133f0160f757af90649710769789631d4a93a0.tar
fosdem-2018-presentation-d4133f0160f757af90649710769789631d4a93a0.tar.gz
fix empty pages in pdf exports (closes #1804)
Diffstat (limited to 'js/reveal.js')
-rw-r--r--js/reveal.js9
1 files changed, 7 insertions, 2 deletions
diff --git a/js/reveal.js b/js/reveal.js
index 6a31424..66ed4d0 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 );