TX Sheet Control

Exporting Worksheets to PDF

Topic

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:

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), or OmitDashboards = 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:

OptionPdfOptions properties
Document metadataTitle, Author, Subject, Keywords, Creator, DocumentProperties
CompressionCompress
Selected sheets and pagesSheet, SheetId, PageNumbers
Locale, time zone and date contextLocale, TimeZone, Date
PDF securitySecurity
Viewer preferencesViewerPreferences
Tagged outputTagged

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