| 1 | --- |
| 2 | depends: |
| 3 | - guide/exporting |
| 4 | - guide/hosting |
| 5 | relates: |
| 6 | - CLI export options: /builtin/cli#export |
| 7 | - Headmatter export options: /custom/#headmatter |
| 8 | tags: [export, build] |
| 9 | description: | |
| 10 | Generate a downloadable PDF along with your slides build. |
| 11 | --- |
| 12 | |
| 13 | # Generate PDF when Building |
| 14 | |
| 15 | You can provide a downloadable PDF in your built slides with the following config in headmatter: |
| 16 | |
| 17 | ```md |
| 18 | --- |
| 19 | download: true |
| 20 | --- |
| 21 | ``` |
| 22 | |
| 23 | Slidev will generate a PDF file along with the build, and a download button will be displayed in the build. |
| 24 | |
| 25 | You can also provide a custom URL for the PDF. In that case, the rendering process will be skipped. |
| 26 | |
| 27 | ```md |
| 28 | --- |
| 29 | download: 'https://myside.com/my-talk.pdf' |
| 30 | --- |
| 31 | ``` |
| 32 | |
| 33 | This can also be done with the CLI option `--download` (`boolean` only). |
| 34 | |
| 35 | ```bash |
| 36 | $ slidev build --download |
| 37 | ``` |
| 38 | |
| 39 | When using the download option, you can also provide the export options via: |
| 40 | |
| 41 | - [CLI export options](/builtin/cli#export) |
| 42 | - [Headmatter export options](/custom/#frontmatter-configures) |
| 43 |