icCube

Documentation

Printing

Printing a report is about adding an action (e.g., a button) within the report. This action has to generate the ' ic3-print-report ' event. Note that a ' single page ' report only is supported for the time being.

Hiding a Widget When Printing

Use the ' No Print ' advanced configuration property to hide widgets when printing.

Note that hiding a widget is internally performed using the CSS class ' ic3-no-print ' that is added to the widget. When printing, the ' body ' element has the ' ic3-print ' CSS class set.

Server Configuration

The printing support is activated and configured on the server side with the ' printComponentConfiguration ' section in the icCube.xml file. Note that section is de-activated by default. As this section is self documented please refer to the actual file for up to date information.

Paper Sizes

Available paper size are configured within this section as well. Here are for example the definition of A4 and Letter formats:


            <paperSize name="A4" width="210mm" height="297mm"/>
            <paperSize name="Letter" width="8.5in" height="11in"/>
    

The underlying printing engine might need some tweak to setup the actual zoom and DPI configuration to ensure the report is fully printed within the page using the whole available space (www). Those settings are depending on the operating system configuration. Here is an example of the settings:


            <fix os="windows" zoom="1" dpi="96"/>
            <fix os="linux" zoom=1"/>
            <fix os="mac" zoom="1"/>
    

Chrome Headless

icCube is using Chrome Headless as its printing engine. So you'll need first to download and install Chrome. See below for an example on a Debian 9 server.

wkhtmltopdf (deprecated)

icCube is using wkhtmltopdf as its printing engine. So you'll need first to download and install it. Please refer to this project's page for more information.

Linux (Headless)

Following are the instructions for installing Chrome headless on Debian 9:


        # wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | sudo apt-key add -

        # echo "deb http://dl.google.com/linux/chrome/deb/ stable main" | sudo tee /etc/apt/sources.list.d/google-chrome.list
        # sudo apt-get update

        # sudo apt-get -y install google-chrome-stable
    

Note that on Linux machine with no X/Server installed (more likely for cloud/server installations) you might need to install XRender and Font Config as well. Here are the command lines for Ubuntu/Debian machines:


        # sudo apt-get install libxrender1
        # sudo apt-get install libfontconfig1
    

You might need as well to install the Microsoft Core Fonts. Here is a page explaining how to do that : www.