diff options
author | Hakim El Hattab <hakim.elhattab@gmail.com> | 2017-01-25 10:43:26 +0100 |
---|---|---|
committer | Hakim El Hattab <hakim.elhattab@gmail.com> | 2017-01-25 10:43:26 +0100 |
commit | 84202fa072970d7170f5e2812a224e0da6f2ab13 (patch) | |
tree | 8d6fb8eba8f6811d8592ed167397bf4dd7e6daae | |
parent | 934c2e9730d56dfea4e2c8e008840161c9099098 (diff) | |
download | fosdem-2018-presentation-84202fa072970d7170f5e2812a224e0da6f2ab13.tar fosdem-2018-presentation-84202fa072970d7170f5e2812a224e0da6f2ab13.tar.gz |
adjust pdf margins instead of heights to fix #1804
-rw-r--r-- | css/print/pdf.css | 2 | ||||
-rw-r--r-- | js/reveal.js | 9 |
2 files changed, 3 insertions, 8 deletions
diff --git a/css/print/pdf.css b/css/print/pdf.css index d3bf951..8c3234c 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: auto !important; + page-break-after: always !important; visibility: visible !important; display: block !important; diff --git a/js/reveal.js b/js/reveal.js index cf174bd..ad79b4b 100644 --- a/js/reveal.js +++ b/js/reveal.js @@ -605,7 +605,7 @@ slideHeight = slideSize.height; // Let the browser know what page size we want to print - injectStyleSheet( '@page{size:'+ pageWidth +'px '+ pageHeight +'px; margin: 0;}' ); + injectStyleSheet( '@page{size:'+ pageWidth +'px '+ pageHeight +'px; margin: 0 0 -1px 0;}' ); // Limit the size of certain elements to the dimensions of the slide injectStyleSheet( '.reveal section>img, .reveal section>video, .reveal section>iframe{max-width: '+ slideWidth +'px; max-height:'+ slideHeight +'px}' ); @@ -652,12 +652,7 @@ // so that no page ever flows onto another var page = document.createElement( 'div' ); page.className = 'pdf-page'; - - // 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 - 1 ) * numberOfPages ) + 'px'; - + page.style.height = ( pageHeight * numberOfPages ) + 'px'; slide.parentNode.insertBefore( page, slide ); page.appendChild( slide ); |