# PrintUserParams Class

> A structure used to set parameters for print jobs.

- Product: Adobe PDF Library 21
- Language: Modern C++
- Version: 21.4.0
- HTML page: https://docs.datalogics.com/apdfl21/ModernCPP/21.4.0/class/PrintUserParams
- Version index: https://docs.datalogics.com/apdfl21/ModernCPP/21.4.0/llms.txt

```cpp
class PrintUserParams
```

**Namespace:** `datalogics_interface`

## 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.

## Constructors

### PrintUserParams

```cpp
datalogics_interface::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.

### PrintUserParams

```cpp
datalogics_interface::PrintUserParams::PrintUserParams(PrintUserParams &&) noexcept
```

*constructor*

**Parameters**

- (unnamed) ([`PrintUserParams &&`](https://docs.datalogics.com/apdfl21/ModernCPP/21.4.0/class/PrintUserParams.md))

### ~PrintUserParams

```cpp
datalogics_interface::PrintUserParams::~PrintUserParams()
```

*destructor*

## Methods

### get_binary_ok

```cpp
int datalogics_interface::PrintUserParams::get_binary_ok() const
```

**Returns:** `int`

Binary ok setting.

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.

### get_collate

```cpp
bool datalogics_interface::PrintUserParams::get_collate() const
```

**Returns:** `bool`

True if copies should be collated.

Collate property.

### get_device_name

```cpp
std::string datalogics_interface::PrintUserParams::get_device_name() const
```

**Returns:** `std::string`

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.

### get_driver_name

```cpp
std::string datalogics_interface::PrintUserParams::get_driver_name() const
```

**Returns:** `std::string`

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

### get_emit_to_file

```cpp
bool datalogics_interface::PrintUserParams::get_emit_to_file() const
```

**Returns:** `bool`

true if a PostScript file is created.

Gets whether a Postscript file is created.

### get_emit_to_printer

```cpp
bool datalogics_interface::PrintUserParams::get_emit_to_printer() const
```

**Returns:** `bool`

true if output to a printer.

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

### get_end_page

```cpp
int datalogics_interface::PrintUserParams::get_end_page() const
```

**Returns:** `int`

the page to end upon

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.

### get_in_file_name

```cpp
std::string datalogics_interface::PrintUserParams::get_in_file_name() const
```

**Returns:** `std::string`

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.

### get_n_copies

```cpp
int datalogics_interface::PrintUserParams::get_n_copies() const
```

**Returns:** `int`

the number of copies that will be printed

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

### get_out_file_name

```cpp
std::string datalogics_interface::PrintUserParams::get_out_file_name() const
```

**Returns:** `std::string`

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.

### get_paper_height

```cpp
unsigned short datalogics_interface::PrintUserParams::get_paper_height() const
```

**Returns:** `unsigned short`

the height of the paper in points

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

### get_paper_width

```cpp
unsigned short datalogics_interface::PrintUserParams::get_paper_width() const
```

**Returns:** `unsigned short`

the width of the paper in points

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

### get_port_name

```cpp
std::string datalogics_interface::PrintUserParams::get_port_name() const
```

**Returns:** `std::string`

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

### get_print_annots

```cpp
int datalogics_interface::PrintUserParams::get_print_annots() const
```

**Returns:** `int`

1 if annotations will be printed, 0 if not

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.

### get_ps_level

```cpp
int datalogics_interface::PrintUserParams::get_ps_level() const
```

**Returns:** `int`

Postscript level setting

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

### get_reverse

```cpp
int datalogics_interface::PrintUserParams::get_reverse() const
```

**Returns:** `int`

1 to reverse page order or 0 for regular order

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.

### get_shrink_to_fit

```cpp
bool datalogics_interface::PrintUserParams::get_shrink_to_fit() const
```

**Returns:** `bool`

true if the page will be shrunk to fit

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.

### get_start_page

```cpp
int datalogics_interface::PrintUserParams::get_start_page() const
```

**Returns:** `int`

the start page

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.

### get_trans_quality

```cpp
int datalogics_interface::PrintUserParams::get_trans_quality() const
```

**Returns:** `int`

the transparency flatting quality, 1 is fastest; 5 is best

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.

### operator=

```cpp
PrintUserParams & datalogics_interface::PrintUserParams::operator=(PrintUserParams &&) noexcept
```

**Parameters**

- (unnamed) ([`PrintUserParams &&`](https://docs.datalogics.com/apdfl21/ModernCPP/21.4.0/class/PrintUserParams.md))

**Returns:** [`PrintUserParams &`](https://docs.datalogics.com/apdfl21/ModernCPP/21.4.0/class/PrintUserParams.md)

### set_binary_ok

```cpp
void datalogics_interface::PrintUserParams::set_binary_ok(int value)
```

**Parameters**

- `value` (`int`): Binary Ok setting.

**Returns:** `void`

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

### set_collate

```cpp
void datalogics_interface::PrintUserParams::set_collate(bool value)
```

**Parameters**

- `value` (`bool`): True if need to collate copies.

**Returns:** `void`

Collate property.

These private functions are used to keep the DevMode (or Mac PMSession/Settings/Etc) in 'sync': all relevant fields in both structures should agree on common settings at the moment PDFLPrintDoc() (in CDocument) is called. This synchronization is necessary because DevMode settings can change outside of DLE's direct control (e.g. print dialog box).

UpdateDevModeAndNamesFromPrintDlgInternal(): Updates the DevMode and DevNames with handles pulled from a PRINTDLG UpdateDevModeFromPrintUserParamsInternal(): Updates the DevMode with values from the current PrintUserParams UpdatePrintUserParamsFromDevModeInternal(): Updates the PrintUserParams with values from the current DevMode

### set_device_name

```cpp
void datalogics_interface::PrintUserParams::set_device_name(const std::string &name)
```

**Parameters**

- `name` (`const std::string &`): the device name

**Returns:** `void`

### set_driver_name

```cpp
void datalogics_interface::PrintUserParams::set_driver_name(const std::string &name)
```

**Parameters**

- `name` (`const std::string &`): the driver name

**Returns:** `void`

### set_emit_to_file

```cpp
void datalogics_interface::PrintUserParams::set_emit_to_file(bool value)
```

**Parameters**

- `value` (`bool`): pass true to emit output to a PostScript file

**Returns:** `void`

Sets whether a Postscript file is created. You set either this parameter or emitToPrinter, but not both.

### set_emit_to_printer

```cpp
void datalogics_interface::PrintUserParams::set_emit_to_printer(bool value)
```

**Parameters**

- `value` (`bool`): pass true to emit to the printer

**Returns:** `void`

Sets whether to Output the PDF document to a Postscript Printer. Set either this parameter or emitToFile, but not both.

### set_end_page

```cpp
void datalogics_interface::PrintUserParams::set_end_page(int page)
```

**Parameters**

- `page` (`int`): the page to end upon

**Returns:** `void`

Sets 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.

### set_in_file_name

```cpp
void datalogics_interface::PrintUserParams::set_in_file_name(const std::string &name)
```

**Parameters**

- `name` (`const std::string &`): the input file name used as the Title DSC comment in the generated Postscript file.

**Returns:** `void`

### set_n_copies

```cpp
void datalogics_interface::PrintUserParams::set_n_copies(int copies)
```

**Parameters**

- `copies` (`int`): the number of copies to print.

**Returns:** `void`

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

### set_out_file_name

```cpp
void datalogics_interface::PrintUserParams::set_out_file_name(const std::string &name)
```

**Parameters**

- `name` (`const std::string &`): the out file name

**Returns:** `void`

### set_paper_height

```cpp
void datalogics_interface::PrintUserParams::set_paper_height(unsigned short height)
```

**Parameters**

- `height` (`unsigned short`): the height of the paper in points

**Returns:** `void`

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

### set_paper_width

```cpp
void datalogics_interface::PrintUserParams::set_paper_width(unsigned short width)
```

**Parameters**

- `width` (`unsigned short`): the width of the paper in points

**Returns:** `void`

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

### set_port_name

```cpp
void datalogics_interface::PrintUserParams::set_port_name(const std::string &name)
```

**Parameters**

- `name` (`const std::string &`): the port name

**Returns:** `void`

### set_print_annots

```cpp
void datalogics_interface::PrintUserParams::set_print_annots(int value)
```

**Parameters**

- `value` (`int`): 1 to print annotations, 0 to not print them.

**Returns:** `void`

Sets 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.

### set_ps_level

```cpp
void datalogics_interface::PrintUserParams::set_ps_level(int level)
```

**Parameters**

- `level` (`int`): Postscript Level setting.

**Returns:** `void`

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

### set_reverse

```cpp
void datalogics_interface::PrintUserParams::set_reverse(int value)
```

**Parameters**

- `value` (`int`): 1 to reverse page order or 0 for regular order

**Returns:** `void`

Sets 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.

### set_shrink_to_fit

```cpp
void datalogics_interface::PrintUserParams::set_shrink_to_fit(bool value)
```

**Parameters**

- `value` (`bool`): pass true to shrink the page to fit

**Returns:** `void`

Sets 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.

### set_start_page

```cpp
void datalogics_interface::PrintUserParams::set_start_page(int page)
```

**Parameters**

- `page` (`int`): the page to start on

**Returns:** `void`

Sets 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.

### set_trans_quality

```cpp
void datalogics_interface::PrintUserParams::set_trans_quality(int quality)
```

**Parameters**

- `quality` (`int`): the transparency flatting quality, 1 is fastest; 5 is best

**Returns:** `void`

Sets 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.
