Show / Hide Table of Contents

# Class PrinterMode

PrinterMode is a utility class used to set printer options for printing PDF documents.

##### Inheritance

object
PrinterMode

##### Implements

IDisposable

##### Inherited Members

object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()

###### Namespace: pdftron.PDF

###### Assembly: PDFNet.dll

##### Syntax

    public class PrinterMode : IDisposable

### Constructors

#### PrinterMode()

Instantiate a new PrinterMode

##### Declaration

    public PrinterMode()

### Methods

#### Dispose()

Releases all resources used by the PrinterMode

##### Declaration

    public override sealed void Dispose()

#### Dispose(bool)

##### Declaration

    [HandleProcessCorruptedStateExceptions]
    protected virtual void Dispose(bool A_0)

##### Parameters

Type | Name | Description
--- | --- | ---
bool | A_0 |

#### ~PrinterMode()

##### Declaration

    protected ~PrinterMode()

#### SetAutoCenter(bool)

Set automatic centering of document pages onto the output pages.

##### Declaration

    public void SetAutoCenter(bool autoCenter)

##### Parameters

Type | Name | Description
--- | --- | ---
bool | autoCenter | if true will center document pages onto the output pages. Default is true.

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### SetAutoRotate(bool)

Set automatic rotation of document pages to best fit the output pages.

##### Declaration

    public void SetAutoRotate(bool autoRotate)

##### Parameters

Type | Name | Description
--- | --- | ---
bool | autoRotate | if true will rotate document pages onto the output pages. Default is true.

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### SetCollation(bool)

Set the collation of the printing, useful for multiple copies.

##### Declaration

    public void SetCollation(bool collation)

##### Parameters

Type | Name | Description
--- | --- | ---
bool | collation | if true, pages of copies will be printed 1, 2, 3. if false, then pages of copies will be printed 1, 1, 1, ..., 2, 2, 2, ...

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### SetCopyCount(int)

Set the number of copies to be printed.

##### Declaration

    public void SetCopyCount(int copyCount)

##### Parameters

Type | Name | Description
--- | --- | ---
int | copyCount | the number of copies to be printed, must be greater than zero

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### SetDPI(int)

Set the DPI (dots per inch) of the printing.

##### Declaration

    public void SetDPI(int dpi)

##### Parameters

Type | Name | Description
--- | --- | ---
int | dpi | the new dPI

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### SetDuplexing(DuplexMode)

Set the duplexing mode.

##### Declaration

    public void SetDuplexing(PrinterMode.DuplexMode mode)

##### Parameters

Type | Name | Description
--- | --- | ---
PrinterMode.DuplexMode | mode | the new duplexing

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### SetNUp(uint, uint)

Set the number of document pages to place on the output pages across and vertically. Pages will be automatically rotated to best fit the page.

##### Declaration

    public void SetNUp(uint x, uint y)

##### Parameters

Type | Name | Description
--- | --- | ---
uint | x | number of papes in horizontal direction
uint | y | number of pages in vertical direction

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### SetNUp(uint, uint, NUpPageOrder)

Set the number of document pages to place on the output pages across and vertically. Pages will be automatically rotated to best fit the page.

Typical values: (2,1) 2-up; (2,2) 4 per page, etc

##### Declaration

    public void SetNUp(uint x, uint y, PrinterMode.NUpPageOrder pageOrder)

##### Parameters

Type | Name | Description
--- | --- | ---
uint | x | number of document pages across. Default is 1.
uint | y | number of document pages down. Default is 1.
PrinterMode.NUpPageOrder | pageOrder | order of document pages across and down output page Default is e_PageOrder_LeftToRightThenTopToBottom.

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### SetNUp(NUp)

Set the number of document pages to place on the output pages across and vertically. Pages will be automatically rotated to best fit the page.

##### Declaration

    public void SetNUp(PrinterMode.NUp nup)

##### Parameters

Type | Name | Description
--- | --- | ---
PrinterMode.NUp | nup | given `NUp` object

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### SetNUp(NUp, NUpPageOrder)

Set the number of document pages to place on the output pages across and vertically. Pages will be automatically rotated to best fit the page.

##### Declaration

    public void SetNUp(PrinterMode.NUp nup, PrinterMode.NUpPageOrder pageOrder)

##### Parameters

Type | Name | Description
--- | --- | ---
PrinterMode.NUp | nup | one of {e_NUp_1_1, e_NUp_2_1, e_NUp_2_2, e_NUp_3_2, e_NUp_3_3, e_NUp_4_4}. Default is e_NUp_1_1.
PrinterMode.NUpPageOrder | pageOrder | order of document pages across and down output page. Default is e_PageOrder_LeftToRightThenTopToBottom.

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### SetOrientation(Orientation)

Set the orientation of the output document.

##### Declaration

    public void SetOrientation(PrinterMode.Orientation orientation)

##### Parameters

Type | Name | Description
--- | --- | ---
PrinterMode.Orientation | orientation | {e_Orientation_Portrait, e_Orientation_Landscape} Default is e_Orientation_Portrait.

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### SetOutputAnnot(PrintContentTypes)

Set the printing of annotations.

##### Declaration

    public void SetOutputAnnot(PrinterMode.PrintContentTypes printContent)

##### Parameters

Type | Name | Description
--- | --- | ---
PrinterMode.PrintContentTypes | printContent | one of {e_PrintContent_DocumentOnly, e_PrintContent_DocumentAndAnnotations}. Default is e_PrintContent_DocumentAndAnnotations.

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### SetOutputColor(OutputColor)

Set the color output of the printing.

##### Declaration

    public void SetOutputColor(PrinterMode.OutputColor color)

##### Parameters

Type | Name | Description
--- | --- | ---
PrinterMode.OutputColor | color | the new output color

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### SetOutputPageBorder(bool)

Set the printing of page borders, helpful when printing multiple document pages per output page.

##### Declaration

    public void SetOutputPageBorder(bool printBorder)

##### Parameters

Type | Name | Description
--- | --- | ---
bool | printBorder | if true will add a thin frame around each page border. Default is false.

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### SetOutputQuality(OutputQuality)

Set the quality of the printing. Overridden if SetDPI is called.

##### Declaration

    public void SetOutputQuality(PrinterMode.OutputQuality quality)

##### Parameters

Type | Name | Description
--- | --- | ---
PrinterMode.OutputQuality | quality | the new output quality

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### SetPaperSize(PaperSize)

Set the output printer paper size (assumed to be correct).

##### Declaration

    public void SetPaperSize(PrinterMode.PaperSize size)

##### Parameters

Type | Name | Description
--- | --- | ---
PrinterMode.PaperSize | size | `PaperSize` object

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### SetPaperSize(Rect)

Set the output printer paper size (assumed to be correct).

##### Declaration

    public void SetPaperSize(Rect size)

##### Parameters

Type | Name | Description
--- | --- | ---
Rect | size | the size of the output paper size in points (72 points = 1 inch). Default is US Letter or Rect(0, 0, 612, 792)

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### SetScale(double)

Set the scaling of the document pages to the output pages. Causes SetScaleType(e_ScaleType_CustomScale) to be set.

##### Declaration

    public void SetScale(double scale)

##### Parameters

Type | Name | Description
--- | --- | ---
double | scale | to apply to document pages. 1.0 is no scale, greater than 1.0 increases document page sizes, less than 1.0 reduces document pages sizes on output pages. Default is 1.0

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### SetScaleType(ScaleType)

Set the scaling of the document page to the output pages.

##### Declaration

    public void SetScaleType(PrinterMode.ScaleType scaleType)

##### Parameters

Type | Name | Description
--- | --- | ---
PrinterMode.ScaleType | scaleType | one of {e_ScaleType_None, e_ScaleType_FitToOutputPage, e_ScaleType_ReduceToOutputPage}. Default is e_ScaleType_None.

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### SetUseRleImageCompression(bool)

Set whether RLE image compression is used for printing bitmaps.

##### Declaration

    public void SetUseRleImageCompression(bool useRleImageCompression)

##### Parameters

Type | Name | Description
--- | --- | ---
bool | useRleImageCompression | if true, printer spool file will be reduced. However, some printers do not support this type of image compression and will produce blank pages. Default is false

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

### Implements

IDisposable