Exporting my Gantt chart to PDF

Article ID: 2318
Last updated: 29 May, 2018
Article ID: 2318
Last updated: 29 May, 2018
Revision: 3
Views: 803
Posted: 07 Jan, 2010
by Dean J.
Updated: 29 May, 2018
by Gargani A.

Question

How to export my Gantt chart to PDF?

Answer

PDF generation uses the standard XSL-FO format as an intermediate format:

Gantt Chart --> XSL-FO --> PDF

The XSL-FO format allows you to fine-tune the details of the page layout.

  1. To perform the first step, use the ilog.views.util.print.IlvFOUtil class, which contains utility

    functions for converting graphic components to XSL-FO. More specifically, you will use the IlvFOUtil.paintToFO() method.

    • First create a DOMImplementation.
    • Then create an XSL-FO document.
    • Finally, add your Gantt chart to the XSL-FO document.

    See the GanttSample.saveAsPDF() method from the attached sample for more details. Note, that for IlvFOUtil.paintToFO() to work properly, batik-jviews-x.y.jar must be in your CLASSPATH.

  2. The second step, the conversion from FO to PDF, uses the Apache FOP package. This requires that you have the following jars in your CLASSPATH:
    • fop-0.20.5.jar
    • fop-avalon-framework-0.20.5.jar
    • fop-batik-0.20.5.jar

    To illustrate this second step, a PDF Generator that converts XSL-FO to PDF is included within the attached sample. Note that this PDF Generator is for demo purposes only and can be customized to achieve the exact behavior you want.

You can download this complete sample that illustrates the steps described for converting a Gantt chart to PDF.

This article was:   Helpful | Not helpful
Report an issue
Article ID: 2318
Last updated: 29 May, 2018
Revision: 3
Views: 803
Posted: 07 Jan, 2010 by Dean J.
Updated: 29 May, 2018 by Gargani A.
Also listed in


Others in this category