Edit online

Customizing PDF Output Using CSS

The publishing process is driven by a customization CSS.
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.
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:
  1. 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.
  2. 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.
  3. 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.css parameter. The rules from custom CSS will override the rules from the template CSS files.
  4. Run the transformation scenario.
Tip: For more information and some tips in regard to publishing DITA documents to PDF using CSS, watch our Webinar: Transforming DITA documents to PDF using CSS, Part 1 – Page Definitions, Cover Page and PDF Metadata.