Skip to main content
All docs
V24.2

ASPxClientGantt.ExportToPdf(options) Method

Exports Gantt chart data to a PDF document.

#Declaration

TypeScript
ExportToPdf(
    options: any
): any

#Parameters

Name Type Description
options any

PDF export options.

#Returns

Type Description
any

The PDF document.

#Remarks

The ExportToPdf method allows you to save information about the Gantt chart’s layout, appearance, and tasks. This method supports the following options:

  • format {string | width?: number, height?: number } - Specifies the document size.
  • pdfDocument - {jsPDF} - Specifies the PDF document.
  • landscape {boolean} - Specifies whether to use horizontal orientation for the document.
  • fileName {string} - Specifies the file name.
  • exportMode {“all”, “treeList”, “chart”} - Specifies which part of the component to export (chart area, tree list area, or the entire component).
  • dateRange: {“all” | “visible” | startDate? : Date, endDate? : Date, startIndex? : number, endIndex? : number } - Specifies the date range for which to export tasks.
  • margins { left?: number, top?: number, right?: number, bottom?: number } - Specifies the outer indents of the exported area.
  • font - Specifies the font.
    • fontObject - A custom font object. Use the jsPDF font converter to generate a custom font object. Specify font settings and load your font file (.ttf). The converter generates a .js file with the content of your font file. Add the generated .js file or only a base64-encoded string from this file to your project to export data with your font.
    • name - The font name.
    • style {“normal”, “bold”, “italic”} - The font style.
    • weight {“normal”, “bold”, number (400,700)} - The font weight.

Run Demo: ASPxGantt - Export to PDF Run Demo: MVCxGantt - Export to PDF

<dx:ASPxGantt ID="Gantt" runat="server" ClientInstanceName="clientGantt" >
    //...
</dx:ASPxGantt>
var myfont = 'AAEAAAAS...';

var exportOptions = {
    format: "A4",
    landscape: true,
    exportMode: "chart",
    dateRange: "visible",
    font: {
        fontObject: myfont,
        name: 'Roboto-BoldItalic',
    }    
};
clientGantt.ExportToPdf(exportOptions);
See Also