Show / Hide Table of Contents

Class PrinterMode

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

Inheritance
System.Object
PrinterMode
Implements
System.IDisposable
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.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(Boolean)

Declaration
[HandleProcessCorruptedStateExceptions]
protected virtual void Dispose(bool A_0)
Parameters
Type Name Description
System.Boolean A_0

Finalize()

Declaration
protected void Finalize()

SetAutoCenter(Boolean)

Set automatic centering of document pages onto the output pages.

Declaration
public void SetAutoCenter(bool autoCenter)
Parameters
Type Name Description
System.Boolean autoCenter

if true will center document pages onto the output pages. Default is true.

Exceptions
Type Condition
PDFNetException

PDFNetException the PDFNet exception

SetAutoRotate(Boolean)

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

Declaration
public void SetAutoRotate(bool autoRotate)
Parameters
Type Name Description
System.Boolean autoRotate

if true will rotate document pages onto the output pages. Default is true.

Exceptions
Type Condition
PDFNetException

PDFNetException the PDFNet exception

SetCollation(Boolean)

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

Declaration
public void SetCollation(bool collation)
Parameters
Type Name Description
System.Boolean 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(Int32)

Set the number of copies to be printed.

Declaration
public void SetCopyCount(int copyCount)
Parameters
Type Name Description
System.Int32 copyCount

the number of copies to be printed, must be greater than zero

Exceptions
Type Condition
PDFNetException

PDFNetException the PDFNet exception

SetDPI(Int32)

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

Declaration
public void SetDPI(int dpi)
Parameters
Type Name Description
System.Int32 dpi

the new dPI

Exceptions
Type Condition
PDFNetException

PDFNetException the PDFNet exception

SetDuplexing(PrinterMode.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(PrinterMode.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(PrinterMode.NUp, PrinterMode.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

SetNUp(UInt32, UInt32)

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
System.UInt32 x

number of papes in horizontal direction

System.UInt32 y

number of pages in vertical direction

Exceptions
Type Condition
PDFNetException

PDFNetException the PDFNet exception

SetNUp(UInt32, UInt32, PrinterMode.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
System.UInt32 x

number of document pages across. Default is 1.

System.UInt32 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

SetOrientation(PrinterMode.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(PrinterMode.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(PrinterMode.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(Boolean)

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
System.Boolean printBorder

if true will add a thin frame around each page border. Default is false.

Exceptions
Type Condition
PDFNetException

PDFNetException the PDFNet exception

SetOutputQuality(PrinterMode.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(PrinterMode.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
System.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(PrinterMode.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(Boolean)

Set whether RLE image compression is used for printing bitmaps.

Declaration
public void SetUseRleImageCompression(bool useRleImageCompression)
Parameters
Type Name Description
System.Boolean 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

System.IDisposable
Back to top Generated by DocFX