Output parameter. The physical margin (x-coordinate) at the left of the page, in inches.
Output parameter. The physical margin (y-coordinate) at the top of the page, in inches.
Example





In This Topic
GdPicture14 Namespace / GdPictureImaging Class / PrintGetMargins Method

PrintGetMargins Method (GdPictureImaging)

In This Topic
Returns the physical margins (x and y coordinates), that are part of the default page settings property of the active printer. Both margins are used as defaults for all pages to be printed.
Syntax
'Declaration
 
Public Function PrintGetMargins( _
   ByRef LeftMargin As Single, _
   ByRef TopMargin As Single _
) As GdPictureStatus
public GdPictureStatus PrintGetMargins( 
   ref float LeftMargin,
   ref float TopMargin
)
public function PrintGetMargins( 
   var  LeftMargin: Single;
   var  TopMargin: Single
): GdPictureStatus; 
public function PrintGetMargins( 
   LeftMargin : float,
   TopMargin : float
) : GdPictureStatus;
public: GdPictureStatus PrintGetMargins( 
   ref float LeftMargin,
   ref float TopMargin
) 
public:
GdPictureStatus PrintGetMargins( 
   float% LeftMargin,
   float% TopMargin
) 

Parameters

LeftMargin
Output parameter. The physical margin (x-coordinate) at the left of the page, in inches.
TopMargin
Output parameter. The physical margin (y-coordinate) at the top of the page, in inches.

Return Value

A member of the GdPictureStatus enumeration. If the method has been successfully followed, then the return value is GdPictureStatus.OK.

We strongly recommend always checking this status first.

Remarks
Just to remind you that the active printer is the printer identified by the PrintGetActivePrinter method or set by the PrintSetActivePrinter method and it is dedicated to executing all subsequent print jobs using this class as well as utilizing all by you altered printer settings.
Example
Determining information about physical margins of the active printer.
using (GdPictureImaging gdpictureImaging = new GdPictureImaging())
{
    float leftMargin = 0;
    float topMargin = 0;
    gdpictureImaging.PrintGetMargins(ref leftMargin, ref topMargin);
    Console.WriteLine("Printer attribute information:");
    Console.WriteLine("Left margin: {0} inches.", leftMargin.ToString());
    Console.WriteLine("Top margin: {0} inches.", topMargin.ToString());
}
See Also