toPDF

exports data of a data component to a PDF file

object toPDF(string|object|array id, [object options] );

Parameters

idstring|object|arraythe exported view or its ID or an array of IDs
optionsobjectoptional, configuration options

Returns

objecta "promise" object. The promise is resolved with the contents of a PDF file that is ready for downloading.

Example

webix.toPDF($$("table"),{
     filename: "datatable",
     // other config options
});

Related samples

Details

If the first parameter is the array of IDs, several views are exported.

webix.toPDF(["datatable","chart"]);

Configuration options can contain several useful settings. For example, canvas-based components like Chart can be exported as images, if you pass display:"image" parameter:

webix.toPDF("chart", { display:"image" });
See also
Back to top