Printing to a single page with WPF components from Gantt Chart Light Library

By default, the printing behavior of Gantt Chart Light Library components is to split the output content into multiple pages based on the printable page area.

However, sometimes you know that your data source and timeline page duration are both small, and you would like to implement an alternative printing behavior: printing all content of the component scaled up or down to a single page.

To do that with WPF, you can use GetExportedDrawingVisual method of the component instance to obtain a Visual object that can be printed with a PrintVisual call on a PrintDialog instance, having a ScaleTransform pre-computed and applied based on GetExportedSize output and on the printable page size.

For your convenience, we have developed a sample application, showing how you can do all these using C# code.