A plug-in for DITA Open Toolkit that adds PDF print output to the DITA Bootstrap plug-ins.
Use the dita command to add this plug-in and its requirements to your DITA Open Toolkit installation:
dita install dita-bootstrap.specialization
dita install dita-bootstrap.pdfSpecify the pdf format when building output with the dita command. If the plug-in is installed, the Bootstrap-based
XSL-FO overrides will be applied automatically.
dita --input=path/to/your.ditamap \
--format=pdfThe plug-in includes XSL-FO handling for the following DITA Bootstrap components. You can use these through the DITA Bootstrap Specialization elements to achieve a consistent look in print:
- Accordions (
<accordion>) - Alerts (
<alert>) - Badges (
<badge>) - Buttons (
<button>) - Cards (
<card>) - Carousels (
<carousel>as a contact sheet) - Figures (
<fig>) - Grid layout (
<grid-row>,<grid-col>) - Icons (
<icon>) - List groups (
<list-group>) - Notes (
<note>- as<alert>) - Tables (
<table>) - Thumbnails (
<thumbnail>)
The preferred way to use this plug-in is via the DITA Bootstrap domain specializations. These provide native DITA elements with specialized attributes for Bootstrap styling:
<card color="primary" border="1" rounded="yes">
<title>Card Title</title>
<p>Card content goes here.</p>
</card>The print plug-in interprets these specialized elements and attributes to generate equivalent XSL-FO styling in the PDF output.
Most DITA Bootstrap Specializations, as well as many base DITA elements, support the color and border attributes to control their appearance:
-
Color Themes: Use standard Bootstrap themes such as
primary,secondary,success,danger,warning,info,light, anddark.<section color="primary"> <title>Primary Section</title> <p>This section has a primary background color.</p> </section> <alert color="warning"> <p>This is a warning alert.</p> </alert> <badge color="success">New</badge>
-
Border Thickness: Use numeric values from
1to5to control border width.<ph border="1">Bordered phrase</ph> <card border="3" color="info"> <title>Thick Border Card</title> <p>Content...</p> </card>
-
@color: Sets the border and background theme (e.g.,
primaryuses a solid primary border and a subtle primary background).
<thumbnail href="image.png" color="primary"/>The common Bootstrap utility classes for borders, background, text, and spacing can also be used via the outputclass
attribute in DITA topics. The print plug-in interprets these classes and applies corresponding XSL-FO styling.
For more information on the available classes, see the main DITA Bootstrap documentation.
Apache 2.0 © 2026 Jason Fox
Note
Within the sample documentation, where necessary, the texts describing the usage of each component have been copied
directly from the official Bootstrap 5.3 documentation, however DITA markup is used throughout the examples describing
how to implement these components correctly using outputclass. The text is therefore a derivative of "Bootstrap 5.3 docs"
by Twitter, Inc. and the Bootstrap Authors, and used under CC BY 3.0.