aboutsummaryrefslogtreecommitdiff
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
parenta6ecbfa73272977d04e107f878a6afbfd17c6869 (diff)
downloadfreenode-live-2017-presentation-d4133f0160f757af90649710769789631d4a93a0.tar
freenode-live-2017-presentation-d4133f0160f757af90649710769789631d4a93a0.tar.gz
fix empty pages in pdf exports (closes #1804)
-rw-r--r--css/print/pdf.css3
-rw-r--r--js/reveal.js9
2 files changed, 9 insertions, 3 deletions
diff --git a/css/print/pdf.css b/css/print/pdf.css
index 4bfcddc..8c82f73 100644
--- a/css/print/pdf.css
+++ b/css/print/pdf.css
@@ -90,7 +90,7 @@ ul, ol, div, p {
}
.reveal .slides section {
- page-break-after: always !important;
+ page-break-after: auto !important;
visibility: visible !important;
display: block !important;
@@ -139,6 +139,7 @@ ul, ol, div, p {
left: 0;
width: 100%;
height: 100%;
+ z-index: auto !important;
}
/* Display slide speaker notes when 'showNotes' is enabled */
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 );