ArcObjects Library Reference (Controls)  

IPageLayoutControl2.Printer Property

The printer object used by the PageLayoutControl for printing.

ERROR: Syntax information about IPageLayoutControl2.Printer may not be in D:\ArcGIS\DotNet\ESRI.ArcGIS.Controls.dll

[C++]
HRESULT get_Printer(
  IPrinter** ppPrinter
);
[C++]
HRESULT putref_Printer(
  IPrinter* ppPrinter
);
[C++]

Parameters

ppPrinter [out, retval]

  ppPrinter is a parameter of type IPrinter

ppPrinter [in]

  ppPrinter is a parameter of type IPrinter

Product Availability

Available with ArcGIS Engine.

Description

Unless the Printer property has been set to a specific printer, the property will return the default system printer. Before issuing a print always check that the PageLayoutControl has a printer.

[C#]
if (axPageLayoutControl1.Printer != null)
{
    axPageLayoutControl1.PrintPageLayout(1, 1, 0);
}
[Visual Basic .NET]
If Not AxPageLayoutControl1.Printer Is Nothing Then
  AxPageLayoutControl1.PrintPageLayout(1, 1, 0)
End If

See Also

IPageLayoutControl2 Interface