javascript - reveal.js 打印到 pdf 只打印第一张幻灯片?

标签 javascript css google-chrome reveal.js

我正在尝试使用 repo readme 中记录的 reveal.js 的 pdf 导出选项.

我有以下问题:

  • 我在 chrome 打印窗口中没有看到布局选项(横向与纵向)
  • 只打印第一张幻灯片

不知道我做错了什么或如何解决它。我在这个 example file 上使用来自 Github 的最新版本的 reveal.js css 等(sha:131c00689a4c7a18e5c991fc8102347e4594b5d4) .

我在 Ubuntu 14.04 上使用 Google-chrome 版本 34.0.1847.132

最佳答案

  1. 删除

    <link rel="stylesheet" media="print" href="reveal.js/css/print/pdf.css" />
    
  2. 添加

    <!-- If the query includes 'print-pdf', include the PDF print sheet -->
    <script>
      if( window.location.search.match( /print-pdf/gi ) ) {
        var link = document.createElement( 'link' );
        link.rel = 'stylesheet';
        link.type = 'text/css';
        link.href = 'reveal.js/css/print/pdf.css';
        document.getElementsByTagName( 'head' )[0].appendChild( link );
      }
    </script>
    
  3. ?print-pdf 添加到 URL 的末尾,例如将 .../index.html# 更改为 .../index.html?print-pdf#

关于javascript - reveal.js 打印到 pdf 只打印第一张幻灯片?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23571270/

相关文章:

未为 Bootstrap Modal 定义 Javascript 函数

html - CSS div 没有分离

google-chrome - 谷歌浏览器历史sqlite

javascript - Chrome 扩展开发 - POST 到新标签

javascript - 调整所有动态生成的段落的大小

css - chrome 22 和 css(左负)可访问性问题

javascript - 如何将 THREEJS 中相机的焦点更改为现有对象?

javascript - 如何解除 React Native 中的警报?

javascript - 事件在卸载前的未定义位置

倒计时之前/之后的 Javascript 动画