https://github.com/mcshelby/reveal-pdfexport
A reveal.js 3.x / 4.x plugin to easly switch to the built-in PDF export mode and back by pressing a shortcut key.
https://github.com/mcshelby/reveal-pdfexport
pdf pdf-export pdfexport plugin reveal-js revealjs
Last synced: 3 months ago
JSON representation
A reveal.js 3.x / 4.x plugin to easly switch to the built-in PDF export mode and back by pressing a shortcut key.
- Host: GitHub
- URL: https://github.com/mcshelby/reveal-pdfexport
- Owner: McShelby
- License: mit
- Created: 2018-06-07T21:07:29.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2023-02-07T09:59:27.000Z (over 3 years ago)
- Last Synced: 2026-03-05T14:57:27.186Z (3 months ago)
- Topics: pdf, pdf-export, pdfexport, plugin, reveal-js, revealjs
- Language: JavaScript
- Homepage:
- Size: 10.7 KB
- Stars: 6
- Watchers: 1
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PdfExport
A [reveal.js](https://github.com/hakimel/reveal.js/) 3.x / 4.x plugin to easly switch to the built-in PDF export mode and back by pressing a shortcut key.
## Installation
Copy this repository into the plugin folder of your reveal.js presentation, ie ```plugin/pdfexport```.
Add the plugin to the initialization of your presentation, as below.
### reveal 4.x
```javascript
// ..
Reveal.initialize({
// ...
plugins: [
// ..
PdfExport,
]
});
```
### reveal 3.x
```javascript
Reveal.initialize({
// ...
dependencies: [
// ...
{ src: 'plugin/pdfexport/pdfexport.js', async: true },
]
});
```
For **reveal 3.x only** you need to remove all of the following or similar lines from your presentation. Paper- or PDF-stylesheets will be set by the plugin.
```html
var link = document.createElement( 'link' );
link.rel = 'stylesheet';
link.type = 'text/css';
link.href = window.location.search.match( /print-pdf/gi ) ? 'css/print/pdf.css' : 'css/print/paper.css';
document.getElementsByTagName( 'head' )[0].appendChild( link );
```
## Usage
To toggle between screen and PDF mode you can press the ```E``` shortcut on the keyboard.
### Configuration
You can configure some aspects of the plugin by adding the following options to your reveal configuration. Note that all configuration values are optional and will default to the values specified below.
```javascript
Reveal.initialize({
// ...
// Shortcut for toggling between screen and PDF mode
pdfExportShortcut: 'E',
});
```
## License
[MIT licensed](https://en.wikipedia.org/wiki/MIT_License).
Copyright (C) 2020 [Sören Weber](https://soeren-weber.de)