ASP.NET Core MVC Controls | ComponentOne
In This Topic
    IFlexGridDrawSettings Interface
    In This Topic
    File
    wijmo.grid.pdf.js
    Module
    wijmo.grid.pdf

    Represents the settings used by the draw and drawToPosition methods.

    Properties

    Properties

    customCellContent

    Indicates whether custom cell content and style should be evaluated and exported. If set to true then export logic will retrieve cell content using cell.innerText property, and cell style using getComputedStyle(cell). Default is 'undefined' (i.e. false).

    Type
    boolean

    drawDetailRows

    Indicates whether to draw detail rows. If set to false then the detail rows will be ignored; otherwise the detail rows will be drawn empty and their content should be drawn manually using formatItem event handler. Default is 'undefined' (i.e. false).

    Type
    boolean

    embeddedFonts

    Represents an array of custom fonts that will be embedded into the document.

    This sample illustrates how to setup the FlexGridPdfConverter to use two custom fonts, Cuprum-Bold.ttf and Cuprum-Regular.ttf. The first one is applied to the header cells only, while the second one is applied to all the remaining cells.

    wijmo.grid.pdf.FlexGridPdfConverter.export(flex, fileName, {
       embeddedFonts: [{
          source: 'resources/ttf/Cuprum-Bold.ttf',
          name: 'cuprum',
          style: 'normal',
          weight: 'bold'
       }, {
          source: 'resources/ttf/Cuprum-Regular.ttf',
          name: 'cuprum',
          style: 'normal',
          weight: 'normal'
       }],
       styles: {
          cellStyle: {
             font: {
                family: 'cuprum'
             }
          },
          headerCellStyle: {
             font: {
                weight: 'bold'
             }
          }
       }
    });
    
    Type
    IPdfFontFile[]

    exportMode

    Determines the export mode.

    Type
    ExportMode

    formatItem

    An optional callback function called for every exported cell that allows to perform transformations of exported cell value and style, or perform a custom drawing.

    The function accepts the PdfFormatItemEventArgs class instance as the first argument.

    In case of custom drawing the cancel property should be set to true to cancel the default cell content drawing, and the cancelBorders property should be set to true to cancel the default cell borders drawing.

    wijmo.grid.pdf.FlexGridPdfConverter.export(flex, fileName, {
       formatItem: function(args) {
    
           // Change the background color of the regular cells of "Country" column.
           if (args.panel.cellType === wijmo.grid.CellType.Cell && args.panel.columns[args.col].binding === "country") {
               args.style.backgroundColor = 'blue';
           }
       }
    });
    
    Type

    maxPages

    Determines the maximum number of pages to export.

    Type
    number

    progress

    An optional function that gives feedback about the progress of a task. The function accepts a single argument, a number changing from 0.0 to 1.0, where the value of 0.0 indicates that the operation has just begun and the value of 1.0 indicates that the operation has completed.

    wijmo.grid.pdf.FlexGridPdfConverter.export(flex, fileName, {
       progress: function(value) {
    
           // Handle the progress here.
       }
    });
    
    Type

    quickCellStyles

    When turned on, decreases the drawing time by activating the cell styles caching if customCellContent property is enabled.

    The combination of cell's inline style specific properties, own CSS classes and CSS classes of row containing the cell is used as the cache tag. Before the cell style is calculated, the cache is checked first, and if the style associated with the tag is found there, it's taken from there and doesn't get recalculated.

    Using this mode can make the drawing slower when considerable amount of cells have the unique set of CSS classes and inline styles. Also, when pseudo classes like :first-child and :nth-child are used to style the cells and rows, the cell styles can be determined incorrectly.

    The default value is true.

    Type
    boolean

    recalculateStarWidths

    Indicates whether star-sized columns widths should be recalculated against the PDF page width instead of using the grid's width.

    Type
    boolean

    repeatMergedValuesAcrossPages

    Indicates whether merged values should be repeated across pages when the merged range is split on multiple pages.

    Type
    boolean

    styles

    Represents the look and feel of an exported FlexGrid.

    Type
    IFlexGridStyle