bmstu-mt-wp/docs/pdf.md

41 lines
1.6 KiB
Markdown
Raw Normal View History

2018-08-24 12:46:27 +03:00
# Export to PDF
2021-06-21 19:39:13 +03:00
Though publishing your HTML slides as they are is always a better idea, you can export your presentation to PDF to upload it to a service like [SlideShare](https://www.slideshare.net/) or [Notist](https://noti.st/).
2018-08-24 12:46:27 +03:00
There are two ways of doing this: via browser print dialog or via console. Exporting via browser seems like the most convenient option, but in some cases it might take too much time or even freeze your browser if your slides are too heavy or there are too many of them.
## Browser
To export your slides to PDF using a browser, youll need a browser thats capable of reading page size from `@page` CSS rule. Chromium-based browsers such as Chrome, Opera, Yandex work the best.
2021-03-02 19:54:26 +03:00
Open you presentation in a browser and send it to print:
2018-08-24 12:46:27 +03:00
2021-03-02 19:54:26 +03:00
1. Press <kbd>Cmd P</kbd> or <kbd>Ctrl P</kbd>.
2018-08-24 12:46:27 +03:00
2. Select PDF as a target instead of printer.
3. Save resulted file.
![Printing dialog](images/ribbon-printing.png)
## Console
To export your slides to PDF via console, youll need [Node.js](https://nodejs.org/) with npm installed. Once you have it, you can install Shower CLI package thatll take care of export:
2021-03-02 19:54:26 +03:00
```sh
npm install -g @shower/cli
```
2018-08-24 12:46:27 +03:00
Once its installed, it becomes globally available as `shower` command. Run it in your presentations folder like this to get your PDF:
2021-03-02 19:54:26 +03:00
```sh
shower pdf
```
2018-08-24 12:46:27 +03:00
Run `shower --help` for more options. But if its a one-time thing and you dont want to install it globally, you can use built-in command coming with Shower main repository:
2021-03-02 19:54:26 +03:00
```sh
npm install
npm run pdf
```
2018-08-24 12:46:27 +03:00
2021-03-02 19:54:26 +03:00
Youll find `index.pdf` next to your slides.