Exporting Worksheets to PDF
PDF export creates fixed pages from the document content, the print settings and the deployed fonts. It is available in the browser editor and in the independent .NET and Node.js server packages. PDF is save-only.
Save a Workbook as PDF
The following C# code saves the workbook of a ServerSheetControl as report.pdf. control holds a loaded workbook, as in .NET:
await control.SaveAsync("report.pdf", StreamType.PDF, new SaveOptions
{
Pdf = new PdfOptions
{
Locale = "en-US", TimeZone = "UTC", Date = "2026-10-19T00:00:00Z"
}
});
Console.WriteLine(control.LastPdfPageCount);
The code works as follows:
- ServerSheetControl.SaveAsync saves the document to the file
report.pdfin the formatStreamType.PDFof the StreamType enumeration. - SaveOptions holds the save settings, and its Pdf property takes the PDF settings, a PdfOptions object.
- PdfOptions.Locale, PdfOptions.TimeZone and PdfOptions.Date set the locale
en-US, the time zoneUTCand a fixed date as the context of the export. - ServerSheetControl.LastPdfPageCount returns the page count of the saved PDF, which the code writes to the console.
In JavaScript, call await editor.save(StreamType.PDF, options) in the browser editor (Spreadsheet.save) or the server equivalent (ServerSheetControl.save in Node.js). Use the PDF and save option types of that package: backend options can differ from editor-only settings.
Prepare the Document
Before the export:
- Set the paper, margins and print area of each worksheet deliberately, as described in Page Layout and Print Settings.
- Validate the formulas, the merge warnings, the numeric totals and the font availability.
- Large row counts can produce many pages. Do not silently truncate the output to make a conversion faster. Page-selection settings intentionally limit the output only when the application chooses them.
Workbooks With Dashboards
Editable dashboards are retained in TXWB. To export a dashboard PDF, set pdf.dashboardId; the saved theme, fonts, charts and active filters are rendered as final vector output. Exported worksheets can also contain their own supported charts.
Important
Dashboards Need an Explicit Option. Worksheet-only export of a workbook that contains dashboards to XLSX or PDF requires
omitDashboards: true(omitDashboards), orOmitDashboards = true(OmitDashboards) in .NET, to explicitly export the worksheet content only.
Choose the Output Options
The supported options include document metadata, compression, selected sheets and pages where available, a locale, time zone and date context, PDF security and viewer preferences. In .NET, they are properties of PdfOptions:
| Option | PdfOptions properties |
|---|---|
| Document metadata | Title, Author, Subject, Keywords, Creator, DocumentProperties |
| Compression | Compress |
| Selected sheets and pages | Sheet, SheetId, PageNumbers |
| Locale, time zone and date context | Locale, TimeZone, Date |
| PDF security | Security |
| Viewer preferences | ViewerPreferences |
| Tagged output | Tagged |
Tagged output adds document structure. It does not automatically certify accessibility, as Tagged PDF and Accessibility explains. Consult the package-specific reference for default values and exact names.
Deliver the PDF
The application owns delivery and storage. Set an appropriate content type and file name, and authorize downloads. Evaluation output retains its watermark.
Export a Dashboard Report
In a browser, save through the initialized editor so its deployed fonts are available:
const bytes = await editor.save(StreamType.PDF, {
pdf: { dashboardId: dashboard.id, dashboardWidth: 1440, dashboardPage: 'fit' }
});
const url = URL.createObjectURL(new Blob([bytes], { type: 'application/pdf' }));
const link = document.createElement('a');
link.href = url;
link.download = 'performance.pdf';
link.click();
setTimeout(() => URL.revokeObjectURL(url), 5000);
For .NET, use the typed PdfOptions with an existing dashboard handle:
await control.SaveAsync("performance.pdf", StreamType.PDF, new SaveOptions {
Pdf = new PdfOptions {
DashboardId = dashboard.Id,
DashboardWidth = 1440,
DashboardPage = "fit"
}
});
dashboardWidth accepts 480–4096 CSS pixels. fit uses one dashboard-sized page; print uses the current paper size and printable margins. The visible dashboard is exported with its current reporting context. Animation and editing controls are omitted, and PDF branding follows the configured license and whether the editor or server generates the file. Dashboard Viewer describes parameters, metric choices and exploration.
Next Steps
- Page Layout and Print Settings: prepare the paper, margins, print area and scaling that the PDF uses.
- Tagged PDF and Accessibility: author accessible report content and validate the tagged PDF.
- Licensing: review Trial, Developer and OEM export branding.