Exporting to PDF or PNG relies on Playwright for rendering. You will therefore need to install
playwright-chromiumto use this feature. If you are doing exporting in a CI environment, the playwright CI guide can be helpful.
$ npm i -D playwright-chromium
Now export your slides to PDF using the following command
$ slidev export
After a few seconds, your slides will be ready at
PNGs and Markdown
When passing in the
--format png option, Slidev will export PNG images for each slide instead of a PDF.
$ slidev export --format png
You can also compile a markdown file composed of compiled png using
$ slidev export --format md
In case you want to export your slides using the dark version of the theme, use the
$ slidev export --dark
Export Clicks Steps
Available since v0.21
By default, Slidev exports one page per slide with clicks animations disabled. If you want export slides with multiple steps into multiple pages, pass the
$ slidev export --with-clicks
You can also specify a range of slides to export with the
$ slidev export --range 1,4-5,6
Available since v0.36.10
You can generate the PDF outline by passing the
$ slidev export --with-toc
You can specify the output filename with the
$ slidev export --output my-pdf-export
Or in the frontmatter configuration:
--- exportFilename: my-pdf-export ---
Export a range of slides
By default, all slides in the presentation are exported. If you want to export a specific slide or a range of slides you can set the
--range option and specify which slides you would like to export.
$ slidev export --range 1,6-8,10
This option accepts both specific slide numbers and ranges.
The example above would export slides 1,6,7,8, and 10.
Available since v0.36.8
Export only the presenter notes (the last comment block for each slide) into a text document in PDF.
$ slidev export-notes
Single-Page Application (SPA)
See Static Hosting.
For big presentation you might want to increase the playwrigth timeout with
$ slidev export --timeout 60000
You can set the browser executable path for playwright using
$ slidev export --executable-path [path_to_chromium]