Customizing PDF Output Using CSS
The publishing process is driven by a customization CSS.
Warning: You should not edit the CSS stylesheet from
DITA-OT-DIR/plugins/com.oxygenxml.pdf.css/css/print. Instead, create your own
customization.
To change the styling of the output for the DITA Map PDF - based on HTML5 & CSS
and the DITA PDF - based on HTML5 & CSS transformation
scenarios:
- Create the CSS file that will contain all of your customizations. It
is recommended to create this file in your project directory so you can edit it
easily.Tip: If you use the default Chemistry processor in Oxygen XML Editor/Author, you can use LESS instead of CSS. In this case, the customization files should have the .less extension.
- Add your custom CSS rules. As a good starting point you can:
- Check the various topics in this section for assistance with specific types of customizations.
- Use the Oxygen Styles Basket to generate basic selectors for common content.
- For linking the CSS file, you have two options:
- Create a publishing template, create the customization CSS file inside the template folder, and link it to the publishing template descriptor. For assistance, see Publishing Templates.
- Choose an existing publishing template, then edit the scenario and set the full path
to the custom CSS file as the value of the
args.cssparameter. The rules from custom CSS will override the rules from the template CSS files.
- Run the transformation scenario.
Tip: For more information and some tips in regard to
publishing DITA documents to PDF using CSS, watch our Webinars:
- Transforming DITA documents to PDF using CSS, Part 1 –
Page Definitions, Cover Page and PDF Metadata:
- Transforming DITA documents to PDF using CSS, Part 2 –
Book Design, Pagination, Page Layout, and Bookmarks:
- Transforming DITA documents to PDF using CSS, Part 3 –
Advanced Fonts Usage:
- Transforming DITA documents to PDF using CSS, Part 4 –
Advanced CSS Rules: