Export to PDF
Writerside can generate a PDF from your documentation sources. The PDF will contain a table of contents with the page numbers and an optional cover page. It can also have some custom text in the header and footer of every page.
In the Writerside tool window, click Export To and then select PDF.
In the Edit Configurations Settings dialog, you can change the following settings:
- Name
Specify a meaningful name to differentiate between several configurations if you have more than one.
- Instance
Select the instance. By default, the configuration will produce a PDF for the instance selected in the Writerside tool window.
- Save to
Specify the directory where you want to save the generated PDF. By default, it will be saved to the root of your documentation project.
- Keymap
If you have several keymaps defined, select the one that will be used in this PDF.
- Orientation
Select between Portrait and Landscape page orientation.
- Cover page
Add a cover page to the PDF output. Without it, the PDF will start with the table of contents as the first page. On the cover page, you can add a title, logo image, description, and a copyright.
Specify the text that will be used in the header and footer of every page.
- Advanced
Specify the title for the table of contents page.
Click Run to start this run configuration.
After a successful build, check the output for errors and warnings in the Run tool window. If everything is fine, you will see links to the generated HTML and PDF files.
You can create multiple run configurations to quickly generate PDFs for various instances or the same instance with different keymaps, headers, and footers.
Run them from the configurations widget in the main toolbar:
Add more run configurations
Click Edit Configurations in the main toolbar widget or select from the main menu.
In the Run/Debug Configurations dialog, click Add New Configuration and add a new Writerside configuration.
Produce PDF as a build artifact
By default, the Writerside builder produces a documentation website as the build artifact. If you want to automate PDF generation, add the -pdf
option to the main builder command helpbuilderinspect
. In this case, the builder will produce a PDF as an artifact, not the website.
Add an XML file with PDF generation options under the cfg directory. These options are the same as the ones in the PDF run configuration. Here is an example file with PDF generation options:
<pdf landscape="true"> <cover-page> <title>My Awesome App</title> <description>User Guide</description> <copyright>Awesome Co © 2024</copyright> </cover-page> <header>Text in header</header> <footer>Text in footer</footer> <toc-title>Title for Table of Contents page</toc-title> <layout>Windows</layout> </pdf>Specify this file as an argument of the
-pdf
option or the value of thePDF
variable when running the Writerside builder. For more information about running the builder, see Build with Docker.