# PrintUserParams Class

> A structure used to set parameters for print jobs.

- Product: Adobe PDF Library 21
- Language: .NET Framework
- Version: APDFL21.0.0PlusP1e
- HTML page: https://docs.datalogics.com/apdfl21/DotNetFramework/APDFL21.0.0PlusP1e/class/PrintUserParams
- Version index: https://docs.datalogics.com/apdfl21/DotNetFramework/APDFL21.0.0PlusP1e/llms.txt

```csharp
class PrintUserParams : SystemIDisposable
```

**Namespace:** `Datalogics::PDFL`

**Inherits from:** `SystemIDisposable`

## Description

A structure used to set parameters for print jobs.

Two structures provide settings for setting parameters for print jobs, PrintUserParams and PrintParams. PrintUserParams was created first, and then PrintParams was created as an extension of PrintUserParams, to provide more settings to account for changing technology.

When the system seeks to print a document it will pass the content and the print parameters, such as the page size, paper tray, and landscape v. portrait, to the print API in APDFL. If the setting is in PrintParams it will pass the document and parameters to PrintParams and then to PrintUserParams and from there to the print API to complete the printing process.

The print logic may take different code paths depending on whether or not the print content is being sent to a printer or to a file, or if the printing uses PostScript or not. When you see a print setting that appears in both PrintUserParams and PrintParams, such as "ShrinktoFit," set the appropriate value in both of these classes. Also, PrintParams offers a variety of settings related to PostScript, but the use of PrintParams is not limited to PostScript.

**Referenced by:** [`Document`](https://docs.datalogics.com/apdfl21/DotNetFramework/APDFL21.0.0PlusP1e/class/Document.md)

**Uses types:** [`Document`](https://docs.datalogics.com/apdfl21/DotNetFramework/APDFL21.0.0PlusP1e/class/Document.md), [`FarEastFont`](https://docs.datalogics.com/apdfl21/DotNetFramework/APDFL21.0.0PlusP1e/enum/FarEastFont.md), [`PrintParams`](https://docs.datalogics.com/apdfl21/DotNetFramework/APDFL21.0.0PlusP1e/class/PrintParams.md)

## Constructors

### PrintUserParams

```csharp
Datalogics.PDFL.PrintUserParams.PrintUserParams()
```

*constructor*

Constructs a PrintUserParams with default settings.

Initializes the print parameters to default values: paper size set to use the media box, emit to printer enabled, emit to file disabled, and zero copies. On macOS, also initializes the system print session, print settings, and page format.

## Properties

### BinaryOK

```csharp
int Datalogics.PDFL.PrintUserParams.BinaryOK { get; set; }
```

Gets whether to enable Binary data, 1 turns it on and 0 turns it off. It applies to a Postscript printer. This API is available on Windows and macOS only.

### Collate

```csharp
bool Datalogics.PDFL.PrintUserParams.Collate { get; set; }
```

Collate property.

### Command

```csharp
string Datalogics.PDFL.PrintUserParams.Command { get; set; }
```

Gets the Optional command line arguments on Unix. It is used only if emitToPrinter is true. For example, "lp" or "lpr" applies to a Postscript printer. This API is available on Unix only.

### DeviceName

```csharp
string Datalogics.PDFL.PrintUserParams.DeviceName { get; set; }
```

The unicode name of the device to print to (for example, "Distiller Assistant
v3.01"). Available devices can be found in the Windows Registry at HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Devices. It applies to a printer.

### DoOPP

```csharp
int Datalogics.PDFL.PrintUserParams.DoOPP { get; set; }
```

Gets the OverPrint Preview setting, 1 uses it, 0 does not. It applies to a printer. The default is 0. This API is available on Windows and macOS only.

### DriverName

```csharp
string Datalogics.PDFL.PrintUserParams.DriverName { get; set; }
```

The unicode name of the driver (for example, "winspool"). See the registry key for deviceName. It applies to the printer.

### EmitHalftones

```csharp
int Datalogics.PDFL.PrintUserParams.EmitHalftones { get; set; }
```

Gets the Emit half-tones setting, 1 turns it on, 0 turns it off. It applies to a Postscript printer. This API is available on Windows and macOS only.

### EmitToFile

```csharp
bool Datalogics.PDFL.PrintUserParams.EmitToFile { get; set; }
```

Gets whether a Postscript file is created.

### EmitToPrinter

```csharp
bool Datalogics.PDFL.PrintUserParams.EmitToPrinter { get; set; }
```

Gets whether to Output the PDF document to a Postscript Printer.

### EndPage

```csharp
int Datalogics.PDFL.PrintUserParams.EndPage { get; set; }
```

Gets the page on which to finish printing, using zero-based nubmering. It applies to a printer. This API is only available on Windows and macOS only.

### FarEastFontOpt

```csharp
FarEastFont Datalogics.PDFL.PrintUserParams.FarEastFontOpt { get; set; }
```

Gets the Far East Font setting. The default value is DownloadAll. PrintAsImage will not be honored. It applies to a Postscript printer. This API is available on Windows only.

### InFileName

```csharp
string Datalogics.PDFL.PrintUserParams.InFileName { get; set; }
```

Unicode name used for the Windows DOCINFO structure (lpszDocName) that points to a NULL-terminated string that specifying the name of the document. In case of printing/exporting to Postscript, this field sets the Title DSC comment in the generated Postscript file. If inFileName was not provided, the Title DSC comment is filled with the name of pdf document.

### NCopies

```csharp
int Datalogics.PDFL.PrintUserParams.NCopies { get; set; }
```

Gets the number of copies to print. It applies to a Postscript file.

### OutFileName

```csharp
string Datalogics.PDFL.PrintUserParams.OutFileName { get; set; }
```

Unicode name used for the Windows DOCINFO structure (lpszOutput). It points to a NULL-terminated string that specifies the name of an output file. If this pointer is NULL, the output will be sent to the device identified by deviceName, driverName, and portName. It applies to a printer.

### PaperHeight

```csharp
ushort Datalogics.PDFL.PrintUserParams.PaperHeight { get; set; }
```

Gets the Height of paper in points. The default value is 792. It applies to a Postscript printer.

### PaperSource

```csharp
int Datalogics.PDFL.PrintUserParams.PaperSource { get; set; }
```

Paper source property.

### PaperWidth

```csharp
ushort Datalogics.PDFL.PrintUserParams.PaperWidth { get; set; }
```

Gets the Width of paper in points. The default value is 612. It applies to a Postscript printer.

### PortName

```csharp
string Datalogics.PDFL.PrintUserParams.PortName { get; set; }
```

The unicode name of the port (for example, "Ne00"). See the registry key for deviceName. It applies to the printer.

### PrintAnnots

```csharp
int Datalogics.PDFL.PrintUserParams.PrintAnnots { get; set; }
```

Gets the printing annotations setting, 1 turns it on, 0 turns it off. It applies to a printer. This API is available on Windows and macOS only.

### PrintParams

```csharp
PrintParams Datalogics.PDFL.PrintUserParams.PrintParams { get; }
```

Gets the Print Parameter settings.

### PsLevel

```csharp
int Datalogics.PDFL.PrintUserParams.PsLevel { get; set; }
```

Gets the Postscript level. It applies to a Postscript printer. This API is available on Windows and macOS only.

### Reverse

```csharp
int Datalogics.PDFL.PrintUserParams.Reverse { get; set; }
```

Gets whether to reverses print order, 1 reverses it and 0 does regular order. It applies to a printer. This API is available on Windows and macOS only.

### ShrinkToFit

```csharp
bool Datalogics.PDFL.PrintUserParams.ShrinkToFit { get; set; }
```

Gets the Shrink to fit setting, true turns it on, false turns it off. It applies to a Postscript printer. This API is available on Windows and macOS only.

### StartPage

```csharp
int Datalogics.PDFL.PrintUserParams.StartPage { get; set; }
```

Gets the page to start printing with, using zero-based numbering. It applies to a printer. This API is only available on Windows and macOS only.

### StartResult

```csharp
int Datalogics.PDFL.PrintUserParams.StartResult { get; set; }
```

Gets the Spooler ID from StartDoc. This API is available on Windows and Unix only.

### TransQuality

```csharp
int Datalogics.PDFL.PrintUserParams.TransQuality { get; set; }
```

Gets the Transparency flattening quality control. 1 is fastest; 5 is best. The default is 3. It applies to a printer. This API is available on Windows only.

### UseCustomPaperSize

```csharp
bool Datalogics.PDFL.PrintUserParams.UseCustomPaperSize { get; set; }
```

Gets whether to force the use of the paper size provided in the PaperWidth and PaperHeight parameters and not search for best fit size provided by printer. SetPageSize must also be set.

## Fields

### UseCropBox

```csharp
static const ushort Datalogics.PDFL.PrintUserParams.UseCropBox
```

*static*

When paper height and width are initialized to this value the crop box of each individual page will be used to determine the paper size.

### UseMediaBox

```csharp
static const ushort Datalogics.PDFL.PrintUserParams.UseMediaBox
```

*static*

When paper height and width are initialized to this value the printed product more closely resembles what comes out of most PDF Viewers. This can eliminate some print problems, including PCL blank page problems.

## Methods

### ChoosePaperSourceBySize

```csharp
void Datalogics.PDFL.PrintUserParams.ChoosePaperSourceBySize(double width, double height)
```

**Parameters**

- `width` (`double`): the desired width of the output in user units
- `height` (`double`): the desired height of the output in user units

**Returns:** `void`

Choose the best paper source for a given width and height.

Searches the printer's paper list for the smallest paper size that is greater than or equal to the given width and height, including with rotation, and sets up the job to print with that paper size.

To obtain width and height, specify the Right - Left and Top - Bottom of the MediaBox of a representative Page.

The printerName and portName must be set.

If you use this call in conjunction with PosePrintDialog, UseDefaultPrinter, or UpdateFromPrinterSettings, call this function after those functions.

Setting RotateAndCenter to True is recommended with this function.

### Dispose

```csharp
void Datalogics.PDFL.PrintUserParams.Dispose()
```

**Returns:** `void`

### EnumeratePaperSources

```csharp
System.Collections.Generic.IList< System.String > Datalogics.PDFL.PrintUserParams.EnumeratePaperSources()
```

**Returns:** `System.Collections.Generic.IList< System.String >`

Set of the tray/bin names.

Enumerates available tray/bin names for the specified printer.

### PaperSourceIdByName

```csharp
int Datalogics.PDFL.PrintUserParams.PaperSourceIdByName(string trayName)
```

**Parameters**

- `trayName` (`string`): the tray/bin's name whose number need to obtain.

**Returns:** `int`

Tray/Bin number corresponding to the specified name.

Obtain tray/bin number by its name.

### PosePrintDialog

```csharp
bool Datalogics.PDFL.PrintUserParams.PosePrintDialog(Document doc)
```

**Parameters**

- `doc` ([`Document`](https://docs.datalogics.com/apdfl21/DotNetFramework/APDFL21.0.0PlusP1e/class/Document.md)): a Document which will be used to set the maximum page range in the dialog box.

**Returns:** `bool`

true if the user accepted the dialog box, false if it was cancelled

Set the print parameters by posing a dialog box to the user. The parameters set include the printer, page range, paper size, number of copies, and duplexing mode.

Changes to these parameters made by the user will be copied into the corresponding PrintUserParams fields. If you want to override the user's choices, change these fields after calling PosePrintDialog().

### UpdateFromPrinterSettings

```csharp
void Datalogics.PDFL.PrintUserParams.UpdateFromPrinterSettings(System.Drawing.Printing.PrinterSettings settings)
```

**Parameters**

- `settings` (`System.Drawing.Printing.PrinterSettings`): Printer settings

**Returns:** `void`

Update the PrintUserParams from System.Drawing.Printing.PrinterSettings.

The following items are updated:

startPage

endPage

driverName

deviceName

portName

nCopies

paperWidth

paperHeight

DEVMODE

Use this if you pose the print settings dialog box in your own code.

### UseDefaultPrinter

```csharp
void Datalogics.PDFL.PrintUserParams.UseDefaultPrinter(Document doc)
```

**Parameters**

- `doc` ([`Document`](https://docs.datalogics.com/apdfl21/DotNetFramework/APDFL21.0.0PlusP1e/class/Document.md)): a Document which will be used to set the maximum page range.

**Returns:** `void`

Set the print parameters to the defaults. The parameters set include the printer, page range, paper size, number of copies, and duplexing mode.

Operating system defaults for these parameters will be copied into the corresponding PrintUserParams fields. If you want to override the system defaults, change these fields after calling UseDefaultPrinter().
