# Exporting Worksheets to PDF

> Save worksheets as PDF in the browser editor, .NET or Node.js with SaveAsync and PdfOptions: page count, OmitDashboards, metadata, security and tagged output.

- **Product:** TX Sheet Control
- **Section:** Documentation
- **Kind:** Topic
- **Path:** TX Sheet Control > PDF Export > Exporting Worksheets to PDF
- **2028 words**
- **Web URL:** https://docs.textcontrol.com/tx-sheet-control/pdf/export/
- **LLMs URL:** https://docs.textcontrol.com/tx-sheet-control/pdf/export/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-sheet-control/pdf/export/llms-full.txt

---

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](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/serversheetcontrol/llms-full.txt) as `report.pdf`. `control` holds a loaded workbook, as in [.NET](https://docs.textcontrol.com/tx-sheet-control/getting-started/document-processing/dotnet/llms-full.txt):

```csharp
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](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/serversheetcontrol/saveasync-method/llms-full.txt) saves the document to the file `report.pdf` in the format `StreamType.PDF` of the [StreamType](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/streamtype/llms-full.txt) enumeration.
- [SaveOptions](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/saveoptions/llms-full.txt) holds the save settings, and its [Pdf](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/saveoptions/pdf-property/llms-full.txt) property takes the PDF settings, a [PdfOptions](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pdfoptions/llms-full.txt) object.
- [PdfOptions.Locale](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pdfoptions/locale-property/llms-full.txt), [PdfOptions.TimeZone](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pdfoptions/timezone-property/llms-full.txt) and [PdfOptions.Date](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pdfoptions/date-property/llms-full.txt) set the locale `en-US`, the time zone `UTC` and a fixed date as the context of the export.
- [ServerSheetControl.LastPdfPageCount](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/serversheetcontrol/lastpdfpagecount-property/llms-full.txt) 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](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/spreadsheet/save-method/llms-full.txt)) or the server equivalent ([ServerSheetControl.save](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/nodejs/serversheetcontrol/save-method/llms-full.txt) 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](https://docs.textcontrol.com/tx-sheet-control/pdf/page-layout/llms-full.txt).
- **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](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/saveoptions/omitdashboards-property/llms-full.txt)), or `OmitDashboards = true` ([OmitDashboards](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/saveoptions/omitdashboards-property/llms-full.txt)) 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](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pdfoptions/title-property/llms-full.txt), [Author](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pdfoptions/author-property/llms-full.txt), [Subject](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pdfoptions/subject-property/llms-full.txt), [Keywords](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pdfoptions/keywords-property/llms-full.txt), [Creator](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pdfoptions/creator-property/llms-full.txt), [DocumentProperties](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pdfoptions/documentproperties-property/llms-full.txt) |
| Compression | [Compress](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pdfoptions/compress-property/llms-full.txt) |
| Selected sheets and pages | [Sheet](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pdfoptions/sheet-property/llms-full.txt), [SheetId](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pdfoptions/sheetid-property/llms-full.txt), [PageNumbers](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pdfoptions/pagenumbers-property/llms-full.txt) |
| Locale, time zone and date context | `Locale`, `TimeZone`, `Date` |
| PDF security | [Security](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pdfoptions/security-property/llms-full.txt) |
| Viewer preferences | [ViewerPreferences](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pdfoptions/viewerpreferences-property/llms-full.txt) |
| Tagged output | [Tagged](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pdfoptions/tagged-property/llms-full.txt) |

Tagged output adds document structure. It does not automatically certify accessibility, as [Tagged PDF and Accessibility](https://docs.textcontrol.com/tx-sheet-control/pdf/accessibility/llms-full.txt) 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:

```javascript
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:

```csharp
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](https://docs.textcontrol.com/tx-sheet-control/dashboards/viewer/llms-full.txt) describes parameters, metric choices and exploration.

### Next Steps

- [Page Layout and Print Settings](https://docs.textcontrol.com/tx-sheet-control/pdf/page-layout/llms-full.txt): prepare the paper, margins, print area and scaling that the PDF uses.
- [Tagged PDF and Accessibility](https://docs.textcontrol.com/tx-sheet-control/pdf/accessibility/llms-full.txt): author accessible report content and validate the tagged PDF.
- [Licensing](https://docs.textcontrol.com/tx-sheet-control/deployment/licensing/llms-full.txt): review Trial, Developer and OEM export branding.

---

## Nearby

- **Previous:** [Page Layout and Print Settings](https://docs.textcontrol.com/tx-sheet-control/pdf/page-layout/llms-full.txt)
- **Next:** [Tagged PDF and Accessibility](https://docs.textcontrol.com/tx-sheet-control/pdf/accessibility/llms-full.txt)
