-
-
Notifications
You must be signed in to change notification settings - Fork 6
Theme
The com.elovirta.pdf plug-in for DITA-OT extends the built-in PDF2 plug-in by adding support for the theme property. The theme property takes a path to a theme file and changes the styling of the PDF2 output without needing to extend the transtype with XSLT.
Themes can be used to adjust basic settings like cover page images, page sizes, numbering, font properties, background colors and borders, spacing, and running content like page headers and footers.
To generate PDF output with a custom theme, pass the path to the theme file to the dita command with the --theme option:
dita --project=samples/project-files/pdf.xml \
--theme=/path/to/custom-theme-file.yamlThe following topics provide details on the theme file formats and supported configuration options.
A theme file can be written in either JSON or YAML format.
The examples provided here are all in YAML format, which is generally more compact and readable than JSON.
page:
size: A4
header:
content: '{title}'
border-after: solid 1pt black
footer:
content: '{folio}'
text-align: center
style:
body:
font-family: Times New Roman
topic:
font-family: Arial
font-size: 26pt
font-weight: bold
color: grayKeys can be divided and nested wherever a hyphen (-) appears in the name. For example, the key page-size can be expressed as the size key under the page category key. This nested structure is for organizational purposes and not required. All keys are flatted when the theme is loaded.