Class PdfPrintDocument
PDF Class enabling developers granular control over sending printable documents to a physical printer.
An assembly reference to System.Drawing is required in your project.
Note: 'PdfPrintDocument' is only supported on: 'Windows'.
Inheritance
Namespace: IronPdf.PrintDoc
Assembly: IronPdf.dll
Syntax
public class PdfPrintDocument : PrintDocument
Constructors
PdfPrintDocument(PdfDocument, PdfPrintSettings, PrinterSettings, PrintController)
Initializes a new instance of the System.Drawing.Printing.PrintDocument class.
Declaration
public PdfPrintDocument(PdfDocument pdfDocument, PdfPrintSettings settings, PrinterSettings printerSettings, PrintController printController)
Parameters
Type | Name | Description |
---|---|---|
PdfDocument | pdfDocument | An PdfDocument of document. |
PdfPrintSettings | settings | A PdfPrintSettings that configures the print document. |
System.Drawing.Printing.PrinterSettings | printerSettings | A System.Drawing.Printing.PrinterSettings that specifies where and how the document is printed. |
System.Drawing.Printing.PrintController | printController | The System.Drawing.Printing.PrintController that guides the printing process. |
Properties
FlattenDocument
Flatten document before rendering - useful for displaying form field values of a PDF
Declaration
public bool FlattenDocument { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Methods
OnBeforePrintPage(PrintPageEventArgs)
Represents the method that will handle the System.Drawing.Printing.PrintDocument.PrintPage
event of a System.Drawing.Printing.PrintDocument.
Declaration
protected virtual void OnBeforePrintPage(PrintPageEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.Printing.PrintPageEventArgs | e | System.Drawing.Printing.PrintPageEventArgs that contains the event data. |
OnBeforeQueryPageSettings(QueryPageSettingsEventArgs)
Represents the method that handles the System.Drawing.Printing.PrintDocument.QueryPageSettings
event of a System.Drawing.Printing.PrintDocument.
Declaration
protected virtual void OnBeforeQueryPageSettings(QueryPageSettingsEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.Printing.QueryPageSettingsEventArgs | e | A System.Drawing.Printing.QueryPageSettingsEventArgs that contains the event data. |
OnBeginPrint(PrintEventArgs)
Raises the System.Drawing.Printing.PrintDocument.BeginPrint event. It is called
after the System.Drawing.Printing.PrintDocument.Print method is called and before
the first page of the document prints.
Declaration
protected override void OnBeginPrint(PrintEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.Printing.PrintEventArgs | e | A System.Drawing.Printing.PrintEventArgs that contains the event data. |
OnPrintPage(PrintPageEventArgs)
Raises the System.Drawing.Printing.PrintDocument.PrintPage event. It is called
before a page prints.
Declaration
protected override void OnPrintPage(PrintPageEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.Printing.PrintPageEventArgs | e | A System.Drawing.Printing.PrintPageEventArgs that contains the event data. |
OnQueryPageSettings(QueryPageSettingsEventArgs)
Raises the System.Drawing.Printing.PrintDocument.QueryPageSettings event. It
is called immediately before each System.Drawing.Printing.PrintDocument.PrintPage
event.
Declaration
protected override void OnQueryPageSettings(QueryPageSettingsEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.Printing.QueryPageSettingsEventArgs | e | A System.Drawing.Printing.QueryPageSettingsEventArgs that contains the event data. |
Events
BeforePrintPage
Represents the method that will handle the System.Drawing.Printing.PrintDocument.PrintPage
event of a System.Drawing.Printing.PrintDocument.
Declaration
public event PrintPageEventHandler BeforePrintPage
Event Type
Type | Description |
---|---|
System.Drawing.Printing.PrintPageEventHandler |
BeforeQueryPageSettings
Represents the method that handles the System.Drawing.Printing.PrintDocument.QueryPageSettings
event of a System.Drawing.Printing.PrintDocument.
Declaration
public event QueryPageSettingsEventHandler BeforeQueryPageSettings
Event Type
Type | Description |
---|---|
System.Drawing.Printing.QueryPageSettingsEventHandler |