Report CSS Injection

Beta License: AGPL-3 sygel-technology/sy-reporting-engine

This module allows users to adjust the font size of company PDF reports (invoices, sales orders, delivery slips, etc.) directly from the document layout settings.

For advanced visual customization (colors, margins, spacing, etc.), custom CSS can be defined in developer mode. Changes apply globally per company.

Table of contents

Configuration

Basic configuration (functional users)

To configure the font size, you need to:

  • Go to Settings / General Settings / Companies, and click on the ‘Configure Document Layout’ button
  • Edit text size, text size unit, header size, and header size unit

Advanced configuration (technical users)

To directly customize the report css, you need to

  • Go to Settings / General Settings / Companies, and click on the ‘Configure Document Layout’ button
  • Activate the developer mode
  • Go to custom CSS, and write your css there.

Custom CSS affects all company PDF reports and should only be modified by a technical user.

Here you have a list of css code examples you can insert into the custom css.

  • Usefull css properties:

    line-height: 1.5;
    font-weight: 300;
    margin: 0 100px;
    color: blue;
    
  • Special css selectors. Some text blocks of the reports are not edited by normal css because they use special classes that overwrite the main css, you should use this special css selectors to edit those blocks:

    h2 {
        color: blue;
    }
    #informations strong {
        color: blue;
    }
    table * {
        color: blue !important;
    }
    
  • Font size css. It can be usefull knowing that the font size fields of the form view injects a css similar to the following one, with the same attributes and selectors:

    font-size: 16.0px;
    h2 {
        font-size: 32.0px;
    }
    

Usage

To use this module, print a report after changing the configuration. The font size will be your configured one.

This module replaces the old “reports_font_size” module

Known issues / Roadmap

Bug Tracker

Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us to smash it by providing a detailed and welcomed feedback.

Do not contact contributors directly about support or help with technical issues.

Credits

Authors

  • Sygel

Maintainers

This module is part of the sygel-technology/sy-reporting-engine project on GitHub.

You are welcome to contribute.