Exporting a Dashboard to PDF
Our sample projects and report templates can help you learn the basics of working with our products.The dashboard engine runs headless on Node.js — a dashboard can be rendered and exported to PDF without a browser.
Load and export to a file.
How it works. The same engine that powers the browser viewer runs on the server, so dashboards can be generated from schedulers or services.
In the screenshot below you can see the result of the sample code:

Load and export to a file.
var Stimulsoft = require('stimulsoft-dashboards-js');
var report = Stimulsoft.Report.StiReport.createNewDashboard();
report.loadFile("Dashboard.mrt");
report.exportDocumentAsync(function (pdfData) {
var buffer = Buffer.from(pdfData);
require('fs').writeFileSync('./Dashboard.pdf', buffer);
}, Stimulsoft.Report.StiExportFormat.Pdf);require('stimulsoft-dashboards-js')— the dashboard engine as a Node module.exportDocumentAsync(callback, StiExportFormat.Pdf)→Buffer.from(data)+fs.writeFileSync— render and save the file.
How it works. The same engine that powers the browser viewer runs on the server, so dashboards can be generated from schedulers or services.
In the screenshot below you can see the result of the sample code:
