Skip to content

Commit 059cca6

Browse files
committed
abide by configured slide width when exporting to pdf
1 parent 3adaed2 commit 059cca6

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

js/reveal.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -412,13 +412,18 @@ var Reveal = (function(){
412412
*/
413413
function setupPDF() {
414414

415+
// The aspect ratio of pages when saving to PDF in Chrome,
416+
// we need to abide by this ratio when determining the pixel
417+
// size of our pages
418+
var pageAspectRatio = 1.295;
419+
415420
// Dimensions of the PDF pages
416-
var pageWidth = 1122,
417-
pageHeight = 867;
421+
var pageWidth = config.width * 1.3,
422+
pageHeight = Math.round( pageWidth / pageAspectRatio );
418423

419424
// Dimensions of slides within the pages
420-
var slideWidth = 960,
421-
slideHeight = 700;
425+
var slideWidth = config.width,
426+
slideHeight = config.height;
422427

423428
document.body.classList.add( 'print-pdf' );
424429
document.body.style.width = pageWidth + 'px';

0 commit comments

Comments
 (0)