Commit c3e96f1f authored by Hakim El Hattab's avatar Hakim El Hattab
Browse files

make pdf page height offset configurable

parent 2584a6d9
...@@ -166,6 +166,13 @@ ...@@ -166,6 +166,13 @@
// 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,
...@@ -664,15 +671,7 @@ ...@@ -664,15 +671,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';
// Set the total height of the PDF page container.
//
// This is offset by -1 to ensure that the page ends and
// breaks within the document/paper height. Ending exactly
// on the document height breaks in-browser printing, but
// works in CLI printing (phantomjs, wkpdf etc]).
page.style.height = ( ( pageHeight - 1 ) * numberOfPages ) + 'px';
slide.parentNode.insertBefore( page, slide ); slide.parentNode.insertBefore( page, slide );
page.appendChild( slide ); page.appendChild( slide );
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment