PDF 导出

¥PDF Export

可以通过特殊的打印样式表将演示文稿导出为 PDF。以下是一个已上传到 SlideShare 的导出演示文稿的示例:https://slideshare.net/hakimel/revealjs-300

¥Presentations can be exported to PDF via a special print stylesheet. Here's an example of an exported presentation that's been uploaded to SlideShare: https://slideshare.net/hakimel/revealjs-300.

注意:此功能仅确认可在 Google ChromeChromium 中工作。

¥Note: This feature has only been confirmed to work in Google Chrome and Chromium.

说明

¥Instructions

  1. 在查询字符串中包含 print-pdf 来打开你的演示文稿,例如:http://localhost:8000/?print-pdf。你可以在 revealjs.com/demo?print-pdf 上测试此功能。

    ¥Open your presentation with print-pdf included in the query string, for example: http://localhost:8000/?print-pdf. You can test this at revealjs.com/demo?print-pdf.

  2. 打开浏览器内的打印对话框 (CTRL/CMD+P)。

    ¥Open the in-browser print dialog (CTRL/CMD+P).

  3. 将“目标”设置更改为“另存为 PDF”。

    ¥Change the Destination setting to Save as PDF.

  4. 将布局更改为横向。

    ¥Change the Layout to Landscape.

  5. 将边距更改为“无”。

    ¥Change the Margins to None.

  6. 启用“背景图形”选项。

    ¥Enable the Background graphics option.

  7. 点击“保存” 🎉

    ¥Click Save 🎉

Chrome Print Settings

演讲者备注

¥Speaker Notes

通过启用 showNotes,你可以将 演讲者备注 包含在 PDF 导出中。

¥Your speaker notes can be included in the PDF export by enabling the showNotes.

Reveal.configure({ showNotes: true });

注释打印在幻灯片顶部的覆盖框中。如果你希望将它们打印在单独的页面上,请在幻灯片播放结束后将 showNotes 设置为 "separate-page"

¥Notes are printed in an overlay box on top of the slide. If you'd rather print them on a separate page, after the slide, set showNotes to "separate-page".

Reveal.configure({ showNotes: 'separate-page' });

页码

¥Page Numbers

如果你想对打印的页面进行编号,请确保启用 幻灯片编号

¥If you want to number printed pages, make sure to enable slide numbers.

页面大小

¥Page Size

导出尺寸是根据配置的 演示文稿大小 推断出来的。如果幻灯片高度过高,无法在单页中显示,则会扩展到多页。你可以使用 pdfMaxPagesPerSlide 配置选项限制幻灯片可以展开到的页数。例如,为了确保幻灯片不会超过一页打印页,你可以将其设置为 1。

¥Export dimensions are inferred from the configured presentation size. Slides that are too tall to fit within a single page will expand onto multiple pages. You can limit how many pages a slide may expand to using the pdfMaxPagesPerSlide config option. For example, to ensures that no slide ever grows to more than one printed page you can set it to 1.

Reveal.configure({ pdfMaxPagesPerSlide: 1 });

片段的单独页面

¥Separate Pages for Fragments

默认情况下,片段 打印在单独的幻灯片上。这意味着,如果你的幻灯片包含三个片段步骤,它将生成三个单独的幻灯片,其中片段将逐步显示。

¥Fragments are printed on separate slides by default. Meaning if you have a slide with three fragment steps, it will generate three separate slides where the fragments appear incrementally.

如果你希望在同一张幻灯片上打印所有可见状态的片段,则可以使用 pdfSeparateFragments 配置选项。

¥If you prefer printing all fragments in their visible states on the same slide you can use the pdfSeparateFragments config option.

Reveal.configure({ pdfSeparateFragments: false });

其他导出方式

¥Alternative Ways to Export

你还可以使用 decktape 通过命令行将演示文稿转换为 PDF。

¥You can also use decktape to convert your presentation to PDF via the command line.