if (imageFormat != null) {
final Document document = ganttChart.create();
content = BatikImageRenderer.getByteArray(document, ganttChart.getWidth(), imageFormat);
DownloadUtils.setDownloadTarget(content, filename);
} else {
final MimeType type;
if (GanttChartEditForm.EXPORT_MS_PROJECT_MPX.equals(exportFormat) == true) {
content = ExportMSProject.exportMpx(ganttChart);
type = MimeType.MS_PROJECT;
} else if (GanttChartEditForm.EXPORT_MS_PROJECT_XML.equals(exportFormat) == true) {
content = ExportMSProject.exportXml(ganttChart);