abide by configured slide width when exporting to pdf
This commit is contained in:
parent
3adaed2a1e
commit
059cca6fa4
13
js/reveal.js
13
js/reveal.js
|
@ -412,13 +412,18 @@ var Reveal = (function(){
|
||||||
*/
|
*/
|
||||||
function setupPDF() {
|
function setupPDF() {
|
||||||
|
|
||||||
|
// The aspect ratio of pages when saving to PDF in Chrome,
|
||||||
|
// we need to abide by this ratio when determining the pixel
|
||||||
|
// size of our pages
|
||||||
|
var pageAspectRatio = 1.295;
|
||||||
|
|
||||||
// Dimensions of the PDF pages
|
// Dimensions of the PDF pages
|
||||||
var pageWidth = 1122,
|
var pageWidth = config.width * 1.3,
|
||||||
pageHeight = 867;
|
pageHeight = Math.round( pageWidth / pageAspectRatio );
|
||||||
|
|
||||||
// Dimensions of slides within the pages
|
// Dimensions of slides within the pages
|
||||||
var slideWidth = 960,
|
var slideWidth = config.width,
|
||||||
slideHeight = 700;
|
slideHeight = config.height;
|
||||||
|
|
||||||
document.body.classList.add( 'print-pdf' );
|
document.body.classList.add( 'print-pdf' );
|
||||||
document.body.style.width = pageWidth + 'px';
|
document.body.style.width = pageWidth + 'px';
|
||||||
|
|
Loading…
Reference in New Issue