Need a special offer?Find out if your project fits.
+
All documentation
API reference
  • API Reference for older versions
  • print

    print(options: Object)

    [starting from version: 1.4]

    Prints the current view via the OS print manager. If the current view is the drill-through view, the grid or chart view will be printed instead.

    To learn more about printing, see this guide: Print the report.

    Parameters

    Parameter/Type Description
    options
    Object
    optional Contains printing options.
    options.header
    String
    optional String that will be displayed in the header section of the printed PDF file. You can set the options.header as a regular string or an HTML string with tags, inline styles, and Base64 images. The string is rendered in the browser and added as an image to the printed PDF file.
    When setting the header, you can use the following tokens in the string:
    • ##CURRENT-DATE## — displays the date when the printed PDF file was created.
    • ##PAGE-NUMBER## — displays the page numbers in the printed PDF file starting from 1.
    options.footer
    String
    optional String that will be displayed in the footer section of the printed PDF file. You can set the options.footer as a regular string or an HTML string with tags, inline styles, and Base64 images. The string is rendered in the browser and added as an image to the printed PDF file.
    When setting the footer, you can use the following tokens in the string:
    • ##CURRENT-DATE## — displays the date when the printed PDF file was created.
    • ##PAGE-NUMBER## — displays the page numbers in the printed PDF file starting from 1.

    Examples

    1) Print the content:

    flexmonster.print();

    Try the example on JSFiddle.

    2) Add header and footer:

    const options = {
      header:"<div>##CURRENT-DATE##</div>",
      footer:"<div>##PAGE-NUMBER##</div>"
    }
    flexmonster.print(options);

    Open the example on JSFiddle.

    See also

    Print tutorial
    printcomplete
    printstart