prevent pages from overflowing when printing to pdf
This commit is contained in:
parent
66c4e6a77f
commit
fcb6ea8385
1 changed files with 9 additions and 0 deletions
|
@ -597,6 +597,15 @@
|
||||||
top = Math.max( ( pageHeight - contentHeight ) / 2, 0 );
|
top = Math.max( ( pageHeight - contentHeight ) / 2, 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Wrap the slide in a page element and hide its overflow
|
||||||
|
// so that no page ever flows onto another
|
||||||
|
var page = document.createElement( 'div' );
|
||||||
|
page.className = 'page';
|
||||||
|
page.style.overflow = 'hidden';
|
||||||
|
page.style.height = ( pageHeight * numberOfPages ) + 'px';
|
||||||
|
slide.parentNode.insertBefore( page, slide );
|
||||||
|
page.appendChild( slide );
|
||||||
|
|
||||||
// Position the slide inside of the page
|
// Position the slide inside of the page
|
||||||
slide.style.left = left + 'px';
|
slide.style.left = left + 'px';
|
||||||
slide.style.top = top + 'px';
|
slide.style.top = top + 'px';
|
||||||
|
|
Loading…
Reference in a new issue