remove pdf height offset

This commit is contained in:
Hakim El Hattab 2018-03-16 13:52:03 +01:00
parent 511397c177
commit f76b4fda93
1 changed files with 3 additions and 10 deletions

View File

@ -196,13 +196,6 @@
// to PDF, unlimited by default // to PDF, unlimited by default
pdfMaxPagesPerSlide: Number.POSITIVE_INFINITY, 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 // Number of slides away from the current that are visible
viewDistance: 3, viewDistance: 3,
@ -668,8 +661,8 @@
var slideSize = getComputedSlideSize( window.innerWidth, window.innerHeight ); var slideSize = getComputedSlideSize( window.innerWidth, window.innerHeight );
// Dimensions of the PDF pages // Dimensions of the PDF pages
var pageWidth = Math.floor( slideSize.width * ( 1 + config.margin ) ), var pageWidth = Math.ceil( slideSize.width * ( 1 + config.margin ) ),
pageHeight = Math.floor( slideSize.height * ( 1 + config.margin ) ); pageHeight = Math.ceil( slideSize.height * ( 1 + config.margin ) );
// Dimensions of slides within the pages // Dimensions of slides within the pages
var slideWidth = slideSize.width, var slideWidth = slideSize.width,
@ -726,7 +719,7 @@
// so that no page ever flows onto another // so that no page ever flows onto another
var page = document.createElement( 'div' ); var page = document.createElement( 'div' );
page.className = 'pdf-page'; page.className = 'pdf-page';
page.style.height = ( ( pageHeight + config.pdfPageHeightOffset ) * numberOfPages ) + 'px'; page.style.height = ( pageHeight * numberOfPages ) + 'px';
slide.parentNode.insertBefore( page, slide ); slide.parentNode.insertBefore( page, slide );
page.appendChild( slide ); page.appendChild( slide );