LoginSignup
19
19

More than 5 years have passed since last update.

reveal.jsで作った資料をChromeでPDF出力する方法

Last updated at Posted at 2015-07-13

reveal.jsでの資料の作り方の説明はここではしない。

webサーバを起動して作った資料のurlをGoogle Chromeで開く。たとえば、ブラウザでプレゼンをするとき、http://localhost:8080/test-presentation/#というurlになるのであれば、PDF出力する際にはhttp://localhost:8080/test-presentation/?print-pdf/#というurlをまずChromeで表示する。print-pdfという文字列を挿入する必要がある理由は、index.htmlに以下の記述があるためである。

index.html
<!-- Printing and PDF exports -->
<script>
  var link = document.createElement( 'link' );
  link.rel = 'stylesheet';
  link.type = 'text/css';
  link.href = window.location.search.match( /print-pdf/gi ) ? '../reveal.js/css/print/pdf.css' : '../reveal.js/css/print/paper.css';
  document.getElementsByTagName( 'head' )[0].appendChild( link );
</script>

Chromeで開いたら、以下の操作によりPDF出力ができる。
1. Destinationの項目をSave as PDFに変更する。
2. Layoutの項目でLandscapeを選択する。
3. Marginsの項目でNoneを選択する。
4. Saveをクリックする。

19
19
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
19
19