aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorHakim El Hattab <hakim.elhattab@gmail.com>2014-04-26 08:51:33 +0200
committerHakim El Hattab <hakim.elhattab@gmail.com>2014-04-26 08:51:33 +0200
commit059cca6fa4925de7e31c4f600b7954d9215fe878 (patch)
treea8aef90b4540153c6998165f054ff0d1df73a8a9 /js
parent3adaed2a1ee1bb3306cb30aa86b90819d1c03af6 (diff)
downloadperl-software-in-gnu-guix-059cca6fa4925de7e31c4f600b7954d9215fe878.tar
perl-software-in-gnu-guix-059cca6fa4925de7e31c4f600b7954d9215fe878.tar.gz
abide by configured slide width when exporting to pdf
Diffstat (limited to 'js')
-rw-r--r--js/reveal.js13
1 files changed, 9 insertions, 4 deletions
diff --git a/js/reveal.js b/js/reveal.js
index 00c3aa0..b91ca98 100644
--- a/js/reveal.js
+++ b/js/reveal.js
@@ -412,13 +412,18 @@ var Reveal = (function(){
*/
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
- var pageWidth = 1122,
- pageHeight = 867;
+ var pageWidth = config.width * 1.3,
+ pageHeight = Math.round( pageWidth / pageAspectRatio );
// Dimensions of slides within the pages
- var slideWidth = 960,
- slideHeight = 700;
+ var slideWidth = config.width,
+ slideHeight = config.height;
document.body.classList.add( 'print-pdf' );
document.body.style.width = pageWidth + 'px';