PDF Printing

PDF Printing - Print the web page as a .pdf file.

Suppose you have one dashboard where chart and grid are displayed and you need to create a PDF to send to the client.

  1. Navigate to your widget.

  2. Add new button.

  3. Click Event Handling > Before Processing Script.

  4. Write JavaScript to print the page.

    Chart and Grid Example

    Sample:

    var temp1 = app.getGlobalComponent("pageWidget").$el.innerHTML;
    var printContents = temp1;
    var originalContents = document.body.innerHTML;
    document.body.innerHTML = printContents;
    window.print();
    document.body.innerHTML = originalContents;

  5. Run the application. When you click the button, a PDF print popup is displayed.