From 54e256764ce98204caad708b654f6250fb781664 Mon Sep 17 00:00:00 2001 From: Hakim El Hattab Date: Sun, 4 May 2014 08:29:45 +0200 Subject: limit size of media elements when printing to pdf --- js/reveal.js | 3 +++ 1 file changed, 3 insertions(+) (limited to 'js') diff --git a/js/reveal.js b/js/reveal.js index 49b2e7c..ad332a3 100644 --- a/js/reveal.js +++ b/js/reveal.js @@ -461,6 +461,9 @@ // Let the browser know what page size we want to print injectStyleSheet( '@page{size:'+ pageWidth +'px '+ pageHeight +'px; margin: 0;}' ); + // Limit the size of certain elements to the dimensions of the slide + injectStyleSheet( '.reveal img, .reveal video, .reveal iframe{max-width: '+ slideWidth +'px; max-height:'+ slideHeight +'px}' ); + document.body.classList.add( 'print-pdf' ); document.body.style.width = pageWidth + 'px'; document.body.style.height = pageHeight + 'px'; -- cgit v1.2.3