# PdfViewerPreferences Class

> PdfViewerPreferences class in the TX Sheet Control .NET API: API-only PDF 1.7 presentation and print hints. Reader software may choose whether to honor them.

- **Product:** TX Sheet Control
- **Section:** Documentation
- **Kind:** Class
- **Namespace:** `TXTextControl.TXSheetControl.Server`
- **Package:** `TXTextControl.TXSheetControl.Server` (assembly `TXTextControl.TXSheetControl.Api.dll`, from the private NuGet feed or the supplied NuGet folder)
- **Package:** `TXTextControl.TXSheetControl.Blazor` (assembly `TXTextControl.TXSheetControl.Api.dll`, from the private NuGet feed or the supplied NuGet folder)
- **Path:** TX Sheet Control > API Reference > .NET API > TXTextControl.TXSheetControl.Server > PdfViewerPreferences Class
- **1650 words**
- **Web URL:** https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pdfviewerpreferences/
- **LLMs URL:** https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pdfviewerpreferences/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pdfviewerpreferences/llms-full.txt

---

API-only PDF 1.7 presentation and print hints. Reader software may choose whether to honor them.

### Syntax

```csharp
public class PdfViewerPreferences
```

### Members

#### Constructors

| Constructor | Description |
|---|---|
| [Constructor](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pdfviewerpreferences/constructor/llms-full.txt) |  |

#### Properties

| Property | Description |
|---|---|
| [CenterWindow](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pdfviewerpreferences/centerwindow-property/llms-full.txt) | Center the document window on screen. |
| [Direction](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pdfviewerpreferences/direction-property/llms-full.txt) | Reading direction: leftToRight or rightToLeft. |
| [DisplayDocTitle](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pdfviewerpreferences/displaydoctitle-property/llms-full.txt) | Display the document title. Defaults true for tagged output; PDF/UA requires true. |
| [Duplex](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pdfviewerpreferences/duplex-property/llms-full.txt) | Suggested duplex mode: simplex, duplexFlipShortEdge or duplexFlipLongEdge. |
| [FitWindow](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pdfviewerpreferences/fitwindow-property/llms-full.txt) | Fit the document window to the first displayed page. |
| [HideMenubar](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pdfviewerpreferences/hidemenubar-property/llms-full.txt) | Hide the reader menu bar. |
| [HideToolbar](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pdfviewerpreferences/hidetoolbar-property/llms-full.txt) | Hide the reader toolbar. |
| [HideWindowUI](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pdfviewerpreferences/hidewindowui-property/llms-full.txt) | Hide document-window user interface controls. |
| [NonFullScreenPageMode](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pdfviewerpreferences/nonfullscreenpagemode-property/llms-full.txt) | Panel after full-screen mode: useNone, useOutlines, useThumbs or useOC. |
| [NumCopies](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pdfviewerpreferences/numcopies-property/llms-full.txt) | Suggested number of print copies, from 1 through 32767. |
| [PickTrayByPDFSize](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pdfviewerpreferences/picktraybypdfsize-property/llms-full.txt) | Select the printer tray using PDF page size. |
| [PrintArea](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pdfviewerpreferences/printarea-property/llms-full.txt) | Page boundary for printing: mediaBox, cropBox, bleedBox, trimBox or artBox. |
| [PrintClip](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pdfviewerpreferences/printclip-property/llms-full.txt) | Page boundary for print clipping: mediaBox, cropBox, bleedBox, trimBox or artBox. |
| [PrintPageRange](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pdfviewerpreferences/printpagerange-property/llms-full.txt) | Inclusive one-based pairs of exported page numbers, for example \[1, 3, 5, 5\]. |
| [PrintScaling](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pdfviewerpreferences/printscaling-property/llms-full.txt) | Suggested print scaling: none or appDefault. |
| [ViewArea](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pdfviewerpreferences/viewarea-property/llms-full.txt) | Page boundary for display: mediaBox, cropBox, bleedBox, trimBox or artBox. |
| [ViewClip](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pdfviewerpreferences/viewclip-property/llms-full.txt) | Page boundary for display clipping: mediaBox, cropBox, bleedBox, trimBox or artBox. |

### Examples

Apply PdfViewerPreferences to a small working document, then return the exported bytes. The caller can save or download the result.

```csharp
using TXTextControl.TXSheetControl.Server;

async Task<byte[]> CreatePdfViewerPreferencesReportAsync(ServerSheetControl control)
{
    var book = control.Workbook;
    var sheet = await book.Sheets.AtAsync(0);
    await sheet.Cell("B8").SetValueAsync(120);
    await sheet.Cell("B9").SetValueAsync(80);
    await sheet.Cell("B10").SetFormulaAsync("=SUM(B8:B9)");
    await sheet.Cell("A1").SetTextAsync("October invoice");
    await sheet.Cell("A1").FormatAsync(new { fontFamily = "Liberation Sans", fontSize = 16, bold = true, textColor = "#ffffff", fillColor = "#163b63" });
    await sheet.Range("B8:B10").FormatAsync(new { numberFormatCode = "#,##0.00", fontFamily = "Liberation Sans", fontSize = 11 });

    var settings = new PdfViewerPreferences()
    {
        DisplayDocTitle = true,
        PrintScaling = "none"
    };

    return await control.SaveAsync(StreamType.PDF, new SaveOptions { Pdf = new PdfOptions { Title = "October invoice", ViewerPreferences = settings } });
}
```

### See Also

- [TXTextControl.TXSheetControl.Server Namespace](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/llms-full.txt)
- [Exporting Worksheets to PDF](https://docs.textcontrol.com/tx-sheet-control/pdf/export/llms-full.txt)

---

## In This Section

- [PdfViewerPreferences.CenterWindow Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pdfviewerpreferences/centerwindow-property/llms-full.txt): PdfViewerPreferences.CenterWindow property in the TX Sheet Control .NET API: Center the document window on screen. Covers its type bool? and a C# example.
- [PdfViewerPreferences Constructor](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pdfviewerpreferences/constructor/llms-full.txt): PdfViewerPreferences constructor in the TX Sheet Control .NET API, with its syntax, a C# example and remarks on awaiting tasks and handles.
- [PdfViewerPreferences.Direction Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pdfviewerpreferences/direction-property/llms-full.txt): PdfViewerPreferences.Direction property in the TX Sheet Control .NET API: Reading direction: leftToRight or rightToLeft.
- [PdfViewerPreferences.DisplayDocTitle Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pdfviewerpreferences/displaydoctitle-property/llms-full.txt): PdfViewerPreferences.DisplayDocTitle property in the TX Sheet Control .NET API: Display the document title. Defaults true for tagged output.
- [PdfViewerPreferences.Duplex Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pdfviewerpreferences/duplex-property/llms-full.txt): PdfViewerPreferences.Duplex property in the TX Sheet Control .NET API: Suggested duplex mode: simplex, duplexFlipShortEdge or duplexFlipLongEdge.
- [PdfViewerPreferences.FitWindow Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pdfviewerpreferences/fitwindow-property/llms-full.txt): PdfViewerPreferences.FitWindow property in the TX Sheet Control .NET API: Fit the document window to the first displayed page.
- [PdfViewerPreferences.HideMenubar Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pdfviewerpreferences/hidemenubar-property/llms-full.txt): PdfViewerPreferences.HideMenubar property in the TX Sheet Control .NET API: Hide the reader menu bar. Covers its type bool? and a C# example.
- [PdfViewerPreferences.HideToolbar Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pdfviewerpreferences/hidetoolbar-property/llms-full.txt): PdfViewerPreferences.HideToolbar property in the TX Sheet Control .NET API: Hide the reader toolbar. Covers its type bool? and a C# example.
- [PdfViewerPreferences.HideWindowUI Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pdfviewerpreferences/hidewindowui-property/llms-full.txt): PdfViewerPreferences.HideWindowUI property in the TX Sheet Control .NET API: Hide document-window user interface controls.
- [PdfViewerPreferences.NonFullScreenPageMode Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pdfviewerpreferences/nonfullscreenpagemode-property/llms-full.txt): PdfViewerPreferences.NonFullScreenPageMode property in the TX Sheet Control .NET API: Panel after full-screen mode: useNone, useOutlines, useThumbs or useOC.
- [PdfViewerPreferences.NumCopies Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pdfviewerpreferences/numcopies-property/llms-full.txt): PdfViewerPreferences.NumCopies property in the TX Sheet Control .NET API: Suggested number of print copies, from 1 through 32767.
- [PdfViewerPreferences.PickTrayByPDFSize Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pdfviewerpreferences/picktraybypdfsize-property/llms-full.txt): PdfViewerPreferences.PickTrayByPDFSize property in the TX Sheet Control .NET API: Select the printer tray using PDF page size.
- [PdfViewerPreferences.PrintArea Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pdfviewerpreferences/printarea-property/llms-full.txt): PdfViewerPreferences.PrintArea property in the TX Sheet Control .NET API: Page boundary for printing: mediaBox, cropBox, bleedBox, trimBox or artBox.
- [PdfViewerPreferences.PrintClip Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pdfviewerpreferences/printclip-property/llms-full.txt): PdfViewerPreferences.PrintClip property in the TX Sheet Control .NET API: Page boundary for print clipping: mediaBox, cropBox, bleedBox, trimBox or artBox.
- [PdfViewerPreferences.PrintPageRange Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pdfviewerpreferences/printpagerange-property/llms-full.txt): PdfViewerPreferences.PrintPageRange property in the TX Sheet Control .NET API: Inclusive one-based pairs of exported page numbers, for example [1, 3, 5, 5].
- [PdfViewerPreferences.PrintScaling Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pdfviewerpreferences/printscaling-property/llms-full.txt): PdfViewerPreferences.PrintScaling property in the TX Sheet Control .NET API: Suggested print scaling: none or appDefault.
- [PdfViewerPreferences.ViewArea Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pdfviewerpreferences/viewarea-property/llms-full.txt): PdfViewerPreferences.ViewArea property in the TX Sheet Control .NET API: Page boundary for display: mediaBox, cropBox, bleedBox, trimBox or artBox.
- [PdfViewerPreferences.ViewClip Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pdfviewerpreferences/viewclip-property/llms-full.txt): PdfViewerPreferences.ViewClip property in the TX Sheet Control .NET API: Page boundary for display clipping: mediaBox, cropBox, bleedBox, trimBox or artBox.

---

## Nearby

- **Previous:** [PdfSecurityOptions.UserPassword Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pdfsecurityoptions/userpassword-property/llms-full.txt)
- **Next:** [PdfViewerPreferences Constructor](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pdfviewerpreferences/constructor/llms-full.txt)
