FieldSoftware
Home

-----------------------------

.NetCF: C#-VB.Net
 Software Developers


PrinterCE.NetCF SDK
   General Info
   Download & Install
   Purchase & Pricing
   Upgrade from PrinterCE

Getting Started with:
 
C#   -   VB.Net

  Code Examples

Documentation
  PrinterCE for .Net CF
  AsciiCE for .Net CF
  BarcodeCE for .Net CF

  DLL Load Error

eVC (C/C++/MFC), eVB:
  PrinterCE SDK

-----------------------------

Software Developers
  PrinterCE SDK
  PrinterCE.NetCF SDK
  PocketHTMLprint SDK

Special Topics
  Supported Printers
  Bluetooth Printing
  Network Printing

Printing Utilities
  SmartPhonePrint
  PrintPocketCE
  PIEprint
  PocketPixPrint
  PocketShot
 
PocketClipPrint

Arcade Games
  SockOut
  MazeCraze

Contact Info

PrinterCE.NetCF Developer's Guide
Namespace : FieldSoftware.PrinterCE_NetCF
DLLs : PrinterCE_NetCF.dll, PrCE_NetCF.dll
Class Name: PrinterCE

PrinterCE for .Net CF provides the .Net CF software developer with tools to add printing capabilities to C# and VB.Net apps. applications developed in Microsoft’s CE Studio. The PrinterCE.NetCF module contains the following print classes:

bulletPrinterCE for .NetCF: The primary class for printing text, images, drawing objects (lines, rectangles, etc) and much more.
bullet AsciiCE for .NetCF: A separate class that allows for printing pure ASCII text to any ASCII printer.
bullet BarcodeCE for .NetCF: An optional class derived from PrinterCE that adds over a dozen barcode types to PrinterCE.

Simple C# code for using the PrinterCE class to print out "Hello World":

PrinterCE prce = null;
try
{
  prce =
new PrinterCE();       //Create instance of PrinterCE class
  prce.SelectPrinter(
true);
  prce.DrawText("Hello World");
//Print "Hello World" on page
  prce.EndDoc();
               //Done with this page - print it
}
catch (PrinterCEException exc) {
 
if (prce!=null)
  {
    prce.ShutDown();
//Done - free PrinterCE resources
    prce=
null
;
  }
  prce=
null
;
  MessageBox.Show("PrinterCE Exception","Exception");
}
finally
{
 
if (prce!=null)
  {
    prce.ShutDown();
//Done - free PrinterCE resources
    prce=
null
;
  }
}

 

PrinterCE for NetCF Constructors

Create an instance of PrinterCE using one of the following 4 overloaded versions:

Syntax: (4 overloaded versions):
  public PrinterCE();
  public
PrinterCE(string initstr);

  public
PrinterCE(EXCEPTION_LEVEL exclevel);
  public
PrinterCE(EXCEPTION_LEVEL exclevel,string initstr);

Parameters

initstr- Developer's License Key used to unlock PrinterCE. Default is for PrinterCE to run in evaluation mode. After evaluation time limit has expired on a device, PrinterCE will be locked and will not function.

exclevel - Sets level of errors that will cause an exception, using EXCEPTION_LEVEL enumeration:

EXCEPTION_LEVEL Enumeration

Description

NONE

PrinterCE will not throw an exception - use StatusCheck to determine if an error has occurred.

ABORT_JOB

PrinterCE throws an exception if the print job is aborted, either by serious error or user cancel. Certain error conditions that affect only the a specific function will not throw an exception. For example, if DrawPicture is called with an image file that cannot be found or is not a valid image file type.

ALL  (default)

PrinterCE throws an exception for any error found.

Example:
PrinterCE prce1 = new PrinterCE(PrinterCE.EXCEPTION_LEVEL.ABORT_JOB,"YOURLICENSEKEY");
 
//No License Key for evaluation

Remarks

If exception handling is enabled, PrinterCE throws a "PrinterCEException" exception for exception errors found. To catch any PrinterCE, BarcodeCE or AsciiCE thrown exception use:

  catch (PrinterCEException exc) {...

With exception handling disabled, when an error occurs within PrinterCE , the severity of the error is determined and PrinterCE "remembers" this as appropriate and the host app uses StatusCheck to determine if an error condition was found.

For example, if a printer error occurs, the entire printing job must be aborted, so all calls to PrinterCE will remember that it is aborting and this will be handled gracefully. This design allows the app that uses PrinterCE to have a relaxed approach to error handling, even to the point of ignoring errors completely (although it would be kind to the user to do StatusCheck calls and display error dialog boxes as needed).

 

PrinterCE for NetCF Methods and Properties

About

READ-ONLY property returns string describing this version of PrinterCE

Syntax: string aboutstr=PrinterCE1.About  

Returns

String describing this version of PrinterCE - including information on WinCE platform, processor type and version. This string can be used in a MessageBox to display the information - MessageBox.Show(PrinterCE1.About,"PrinterCE Version");

Example

  MessageBox.Show(PrinterCE1.About,"PrinterCE Version");

ConvertCoord

This method converts a value from one ScaleMode system to another.

Syntax:  
double ConvertCoord(double val, MEASUREMENT_UNITS fromscalemode,
            MEASUREMENT_UNITS toscalemode);

MEASUREMENT_UNITS Enumeration

Description

TWIPS

1440 Twips per inch

POINTS

72 points per inch

PIXELS

Printer resolution - for example 300 dpi

INCHES

Inches

MILLIMETERS

Millimeters

CENTIMETERS

Centimeters

Parameters

fromval - Value to be converted
fromscale - "convert from" MEASUREMENT_UNITS
toscale - "convert to" MEASUREMENT_UNITS.

Returns

toval - Converted value.

Example:

To convert 1.25 inches into printer resolution: 
   double PrResVal=PrinterCE1.ConvertCoord(1.25,PrinterCE.MEASUREMENT_UNITS.INCHES,
                
PrinterCE.MEASUREMENT_UNITS.PIXELS);

DrawCircle

Prints a circle or ellipse on a page.

Syntax: (4 overloaded versions):
void DrawCircle(double x,double y,double radius);
void
DrawCircle(double x,double y,double radius,Color pen color);
void
DrawCircle(double x,double y,double radius,double aspect);
void DrawCircle(double x,double y,double radius,Color pen color,
       double aspect);

Parameters

x - Horizontal coordinate for the center point of a circle.
y - Vertical coordinate for the center point of a circle.
radius - Radius of a circle.
color – color of a circle's outline. Default is ForeColor value
aspect – aspect ratio of a circle. The default value is 1.0, which yields a perfect circle. Other values draw an ellipse. (Also see DrawEllipse for another way to draw ellipses).

Remarks

The ScaleMode property of object determines the units of measure used. 
The FillColor and FillStyle properties of object determine how a circle is filled. 
The DrawWidth property determines the width of the line used to draw a circle.

DrawEllipse

Prints an ellipse on a page.

Syntax
(2 overloaded versions):
 
void DrawEllipse(double x1,double y1,double x2,double y2);
void DrawEllipse(double x1,double y1,double x2,double y2,Color pencolor);

Parameters

x1, y1, x2, y2 - Values define a rectangle (x1,y1) as one corner and (x2,y2) as
     opposing corner. An ellipse is drawn that just fits within this bounding rectangle.
color – color of a circle's outline. Default is ForeColor value

Remarks

The ScaleMode property of object determines the units of measure used. 
The FillColor and FillStyle properties of object determine how a circle is filled.
The DrawWidth property determines the width of the line used to draw a circle.

DrawLine

Prints a line
 
Syntax
(2 overloaded versions): 
  void DrawLine(double x1,double y1,double x2,double y2);
 void DrawLine(double x1,double y1,double x2,double y2,Color pencolor);

Parameters

x1, y1 - starting coordinates for a line or rectangle
x2, y2 - ending coordinates for a line or rectangle.
color – Color used to draw a line. Default is ForeColor value.

Remarks

The DrawWidth property determines the width of the line. 
The ScaleMode property determines the unit of measure used.  

DrawPicture

Prints a BMP, JPG, GIF or PNG image file on the page. Note: A few non-Pocket PC devices may not include full image support (BMP should always be supported). You can test your device to verify what file types are supported.

Syntax (2 overloaded versions): 
void DrawPicture(string picture, double x, double y);
void
DrawPicture(string picture, double x, double y, 
    double
width, double height,bool keepaspect);

Parameters

picture : Path & filename of the image to be drawn.
x,y : Coordinates where picture will be drawn (in ScaleMode units). By default, x,y is the top/left corner of the image location. Use JustifyHoriz/JustifyVert to change this to Center or Bottom/Right.

width : Destination width of picture. Default (or if width==0): actual image width
height : Destination height of picture. Default (or if height==0): actual image height is used.
keepaspect :
If true, retains aspect ratio (width to height of original image)... image is sized to fit inside of "width" x "height".

Remarks

If width and/or height are negative values, DrawPicture creates a mirror image along the vertical axis (if width is negative) and/or the horizontal axis (if height is negative). See: GetPictureDims() to get actual image width and height.

DrawPoint

Print a point on the page.

Syntax (2 overloaded versions): 
void DrawPoint(double x,double y);
void
DrawPoint(double x,double y,Color pencolor);

Parameters

x, y - Coordinates of the point to draw (in ScaleMode units)
color - Color used to draw the point. Default is ForeColor value.

Remarks

DrawWidth property determines the size of the point.

DrawRect

Prints a rectangle on a page.

Syntax (2 overloaded versions): 
void DrawRect(double x1,double y1,double x2,double y2);
void DrawRect(double x1,double y1,double x2,double y2,Color pencolor);

Parameters

x1, y1, x2, y2 - defines a rectangle with (x1,y1) as one corner and (x2,y2) as opposing corner
color - Color used to draw the rectangle. Default is ForeColor value.

Remarks

Coordinates are in ScaleMode units. 
FillColor and FillStyle properties of object determine how a rectangle is filled. 
DrawWidth property determines the width of the line used to draw a rectangle.

DrawRoundedRect

Prints a rectangle with rounded corners on a page.

Syntax (2 overloaded versions): 
void DrawRoundedRect(double x1,double y1,double x2,double y2,
   double
corner_width,double corner_height);
void DrawRoundedRect(double x1,double y1,double x2,double y2,
   double
corner_width,double corner_height,Color pencolor);

Parameters

x1, y1, x2, y2 - Defines a rectangle with (x1,y1) as one corner and (x2,y2) as opposing corner.
cornerwidth,cornerheight - defines the width and height of the curve of the rounded rectangle..
color - Color used to draw the rectangle. Default is ForeColor value.

Remarks

Coordinates are in ScaleMode units. 
FillColor and FillStyle properties of object determine how a rectangle is filled. 
DrawWidth property determines the width of the line used to draw a rectangle.

DrawText

Prints text on the page. (See also DrawTextFlow).

Syntax (4 overloaded versions): 
void DrawText(string drawstr);
void DrawText(string drawstr,double x,double y);
void DrawText(string drawstr,Int32 ccnt);
void DrawText(string drawstr,double x,double y,Int32 ccnt);

Parameters

string - Text to be drawn.
x, y - Coordinates of the text to be drawn. Default: string is drawn at the intrinsic (TextX,TextY) coordinates.
ccnt- Number of characters in "string" that should be printed Default: entire line of text is printed.

Remarks

The font properties of the PrinterCE control determines the appearance of the text. 
The ForeColor property determines the color of the text. 
After the text is drawn, TextX, TextY are updated so that the next DrawText command will print on a new line. 
The JustifyHoriz, JustifyVert, and Rotation properties all impact how and where the text is actually drawn on the page. 
Coordinates are in ScaleMode units

DrawTextFlow   (*Exclusive to PrinterCE.NetCF SDK)

Flows printed text on the page, optionally handling word wrap and page breaks automatically. For sample code visit here.

Syntax (4 overloaded versions): 
int DrawTextFlow(string drawstr);
int DrawTextFlow(string drawstr,FLOW_OPTIONS flowtype);
int DrawTextFlow(string drawstr,double left,double top,double width,double height,
                  int
ccnt,FLOW_OPTIONS flowtype);

int DrawTextFlow(string drawstr,double x,double y,double left,double top,
                  double
width,double height,
int ccnt,FLOW_OPTIONS flowtype);

Parameters

drawstr - Text to be drawn.
x, y - Coordinates of the position within the "drawing box" for the top left corner of the start of the text.
         Defaults to x, y coordinates of most recent DrawText/DrawTextFlow call. Pass -1 to use default values
left, top, width, height - Defines a "drawing box" within which the text will be flowed on the page.
         Defaults to left and top margins with full page width and height. Pass -1 to use default values.
ccnt - Number of characters in text string to print. Defaults to all text string. Pass -1 to use default.
flowtype -
Bit flags to enable/disable Draw Flow options (OR these together)

FLOW_OPTIONS Enumeration  Description  

DEFAULT

Default "flow" working mode: auto word-wrap, auto page break (form feed)

NOWORDWRAP

Prints one line of text, determining where to break the text string. Returns number of characters printed.

NOFORMFEED

Prints text, flowing in "drawing box" as appropriate. If reaches the bottom of the "drawing box", stops printing and returns total number of characters printed.

NOENDINGLINEFEED

Normal operation after flowing text into the "drawing box" is to move to the start of the next line (CR/LF). Using NOENDINGLINEFEED causes (x, y) coordinates to be left immediately after the end of the last character printed.

HARDBREAK

Normal operation is for DrawTextFlow to try to "break" a line of text in a natural flow, such as at a space. Use HARDBREAK to fit all text possible onto each line, with break made after the last character that will fit.

Return

Returns number of characters printed during DrawTextFlow operation.

Remarks

- JustifyHoriz and Rotation properties are ignored - DrawTextFlow always draws LEFT justified in NORTH rotation.
- JustifyVert is used to determine vertical justification.
-
The ForeColor property determines the color of the text. 
- Coordinates are in ScaleMode units

DrawWidth

Property: Returns / sets the line width in ScaleMode uints for output from a graphics method. A size of 0 sets line width to 1 pixel.

Syntax:
get: double wid = PrinterCE1.DrawWidth;
set: PrinterCE1.DrawWidth = (double) wid;

EndDoc

Begin printing the current page, then reset printing properties to default.  

Syntax: void EndDoc();

FillColor

Property: Returns / sets the color used to fill in graphics methods: DrawRect, DrawRoundedRect, DrawCircle and DrawEllipse. By default, FillColor is set to 0 (Black).

Examples:
get: Color wid = PrinterCE1.FillColor;
set: PrinterCE1.FillColor = Color.Blue;

Remarks

When the FillStyle property is set to Transparent (default), the FillColor setting is ignored.

FillStyle

Property: Returns / sets the pattern used to fill in graphics methods: DrawRect, DrawRoundedRect, DrawCircle and DrawEllipse. Use FILL_STYLE enumeration:

FILL_STYLE Enumaration

Description

SOLID

Solid

TRANSPARENT

Transparent (default)

Examples:
get: PrinterCE.FILL_STYLE style = PrinterCE1.FillStyle;
set: PrinterCE1.FillStyle= PrinterCE.FILL_STYLE.SOLID;

Remarks

When the FillStyle property is set Transparent, the FillColor setting is ignored. For more selective settings, see FontBoldVal property.

FontBold

Property: Returns / sets the Bold font style to true (Bold ON) or false (Bold OFF);

Examples:
get: bool isbold = PrinterCE1.FontBold;
set: PrinterCE1.FontBold=true;

FontBoldVal

Property: Returns / sets the current font's Bold weight.  

Examples:
get: int boldweight = PrinterCE1.FontBoldVal;
set: PrinterCE1.FontBoldVal=850;

Parameters

value - Integer value between 0 and 1000 to set the weight of the font. Normal weight setting is 400 and standard Bold is 700.

FontItalic

Property: Returns / sets the Italic font style to true (Italic ON) or false (Italic OFF);

Examples:
get: bool isitalic = PrinterCE1.FontItalic;
set: PrinterCE1.FontItalic=true;

FontName

Property: Returns / sets the font used to print text.

Examples:
get: string fontname = PrinterCE1.FontName;
set: PrinterCE1.FontName="Courier New";

Remarks

Any TrueType font can be used. To install a TrueType font to the device, simply copy from desktop PC to \Windows\Fonts folder on the device. You can use Pocket Word -> Edit -> Format -> pull down list of available fonts to see exact font names of all installed fonts.

FontSize

Property: Returns / sets the point size of the font to be used for printing.

Examples:
get: int fontsize = PrinterCE1.FontSize;
set: PrinterCE1.FontSize=14; //Set font size to 14 point

Remarks

Note: to match a point size with equivalent point size of Microsoft Word, use negative point size... for example, to match Word's 12 point font, use PrinterCE1.FontSize = -12.

Max is 2,160 points, min is 4 points. There are 72 points per inch.

FontStrikethru

Property: Returns / sets the Strikethrough style, true = Strikethrough ON, false OFF

Examples:
get: bool isstrikethru = PrinterCE1.FontStrikethru;
set: PrinterCE1.FontStrikethru=true;

FontUnderline

Property: Returns / sets the Underline font style. true = Underline ON, false is OFF

Examples:
get: bool isunderline = PrinterCE1.FontUnderline;
set: PrinterCE1.FontUnderline=true;

ForeColor

Property: Returns / sets the foreground color used to print text. Default is Color.Black

Examples:
get: Color forecolor = PrinterCE1.ForeColor;
set: PrinterCE1.ForeColor=Color.Red;

GetLastErr  (*Exclusive to PrinterCE.NetCF SDK)

ERROR GetLastErr - Read-only property - returns last error type for PrinterCE.NetCF:

ERROR Enumeration

Description

NONE

No current error

PRINT_TASK

Unable to complete printing task.

USER_CANCELLED

Print operation cancelled by user

OUTOFMEMORY

Not enough memory to complete the task

INVALID_ARGUMENT

Invalid argument to PrinterCE.NetCF call

ABORT

Unknown error

PRINTER_DIALOG

Print Dialog error

FONT

Couldn't create font.

IMAGE

Unable to load image.

PRINTER_SETTINGS

Check printer settings (page size, margins, etc)

INFRARED

Unable to establish Infrared link

COMMUNICATION_LINK

Unable to establish link to printer

COMMUNICATION_LOST

Lost communications link to printer

DIALOG

Dialog error... cannot continue

NETWORK

Unable to print across the network.

NET_NOWNET

Network support functions for network printing not found on this device.

NET_CHECKALL

Unable to connect to computer or find network printers. Check computer name and network connection.

NET_NOSERVER

Network unavailable or this device does not support network printing.

BLUETOOTH

Unable to connect with Bluetooth printer... Use Bluetooth Manager to discover your printer and connect it to Serial Port. Verify that Bluetooth Radio is ON.

Example:
  PrinterCE.ERROR errtype = PrinterCE1.GetLastErr;

  if (errtype == PrinterCE.ERROR.USERCANCELLED) {
      //Handle user cancel situation
  }

GetPictureDims   (*Exclusive to PrinterCE.NetCF SDK)

This method returns width and height of an image in an image file in ScaleMode units.

Syntax: bool GetPictureDims(string picture,out double width,out double height);

Parameters
picture : Path & filename of the image to be drawn.

width: Actual width of image
height: Actual height of image

Returns: true if valid picture found.

GetStringHeight

READ-ONLY Property - Returns the height of the current font in ScaleMode units

Syntax: double ht = PrinterCE1.GetStringHeight;

GetStringWidth

Returns the width of the given text string (in ScaleMode units)  

Syntax: double wid = PrinterCE1.GetStringWidth("TextString");

GetVersion

Returns version of PrinterCE.NetCF - forms major.minor.build.revision

Syntax: void GetVersion(out int major,out int minor,out int build,out int revision);

IsColor

READ-ONLY property returns TRUE if current selected printer can print color.

Syntax: bool usescolor = PrinterCE1.IsColor;

JustifyHoriz

Property: Returns / sets the horizontal justification (left, center, right) of following DrawText and DrawImage methods.

JUSTIFY_HORIZ Enumeration

LEFT (Default)

CENTER

RIGHT

Examples:
get: PrinterCE.JUSTIFY_HORIZ hjust = PrinterCE1.JustifyHoriz;
set: PrinterCE1.JustifyHoriz=PrinterCE.JUSTIFY_HORIZ.CENTER;

JustifyVert

Property: Returns / sets the vertical justification (top, center, bottom) of following DrawText and DrawImage methods.

JUSTIFY_VERT Enumeration

TOP (Default)

CENTER

BOTTOM

Examples:
get: PrinterCE.JUSTIFY_VERT vjust = PrinterCE1.JustifyVert;
set: PrinterCE1.JustifyVert=PrinterCE.JUSTIFY_VERT.BOTTOM;

KillDoc

Abort the current page - Flush all print operations and reset printing properties to default.  

Syntax: void KillDoc();

NewPage

Begin printing the current page then prepare for another page of printing commands. Do not reset printing properties to default.

Syntax: void NewPage();

PgIndentLeft

Property: Returns / sets an indent from the left margin of the page where the start of the horizontal printing is found. The value is in printer resolution dots (see PrinterResolution).

Examples:
get: int curleftindent = PrinterCE1.PgIndentLeft;
set: PrinterCE1.PgIndentLeft=300; //Set left indent 300 dots from margin

Remarks

The PgIndentLeft and PgIndentTop settings can be called multiple times while printing one page. All subsequent drawing methods use the new settings. Use this technique to easily print multiple columns and/or rows of items.  

PgIndentTop

Property: Returns / sets an indent from the top margin of the page where the start of the vertical printing is found. The value is in printer resolution dots (see PrinterResolution).

Examples:
get: int curtopindent = PrinterCE1.PgIndentTop;
set: PrinterCE1.PgIndentTop=300; //Set top indent 300 dots from margin

Remarks

The PgIndentLeft and PgIndentTop settings can be called multiple times while printing one page. All subsequent drawing methods use the new settings.

PrBottomMargin

Property: Returns / sets the bottom margin of the page. The value is in ScaleMode units.

Examples:
get:
double curBottomMgn = PrinterCE1.PrBottomMargin;
set: PrinterCE1.PrBottomMargin = (
double) 0.75;

PrDialogBox

Property: Returns / sets the action of the "Printing in progress" dialog box (which allows the user to cancel the print operation).

DIALOGBOX_ACTION Enumeration

Description

UP

Display "in progress" dialog box

DOWN

Take down dialog box

DISABLE

Prevent dialog box from being used

STATUS

Display status of printing operation

DEBUG_ON

Uses "in progress" dialog box to show details about internal mode of PrinterCE during printing. (Off by default).

DEBUG_OFF

Turns off Debug mode. 

Examples:
get: PrinterCE.DIALOGBOX_ACTION
dbox = PrinterCE1.PrDialogBox;
set: PrinterCE1.PrDialogBox = PrinterCE.DIALOGBOX_ACTION.UP;

Remarks

By default, the "Printing in progress" dialog box is displayed with the first call by VB to a PrinterCE page operation (such as Select Printer, Draw Object, etc). This dialog box will remain until EndDoc or KillDoc completes the printing job. Calling PrDialogBox(vbDlgDisable) will prevent PrinterCE from displaying the dialog box (and will not give the user any chance to cancel).

See PrDialogBoxText() to change the text displayed or language used by this dialog.

PrDialogBoxText

This method allows changing the text displayed or language used by the "Printing in progress" dialog box.  

Syntax: void PrDialogBoxText(string MainText,string TitleText,
            string
CancelBtnText);

Parameters

MainStr - String for main text portion of the "Printing in progress" dialog box.
TitleStr - String for title portion of the "Printing in progress" dialog box.
CancelBtnStr - String for Cancel Button portion of the "Printing in progress" dialog box 

Remarks

The text of this dialog box may be changed at any time… if the dialog box is already displayed, it will be taken down, the new text added, and then the dialog box will be redisplayed. If the dialog box is not currently displayed, it will remain down until a call to PrDialogBox() or until PrinterCE automatically displays it.

PrinterResolution

READ-ONLY property returns "dots per inch" resolution of currently selected printer

Syntax: int prRes = PrinterCE1.PrinterResolution;

PrLeftMargin

Property: Returns / sets the left margin of the page. The value is in ScaleMode units.

Examples:
get:
double curLeftMgn = PrinterCE1.PrLeftMargin;
set: PrinterCE1.PrLeftMargin = (
double) 0.75;

PrRightMargin

Property: Returns / sets the right margin of the page. The value is in ScaleMode units.

Examples:
get:
double curRightMgn = PrinterCE1.PrRightMargin;
set: PrinterCE1.PrRightMargin = (
double) 0.75;

PrSetDefaults

This method causes the printer control to reset all printer-specific values to the printer defaults.  

Syntax: void PrinterCE1.PrSetDefaults();

PrTopMargin

Property: Returns / sets the top margin of the page. The value is in ScaleMode units.

Examples:
get:
double curTopMgn = PrinterCE1.PrTopMargin;
set: PrinterCE1.PrTopMargin = (
double) 0.75;

PrOrientation

This property returns and sets the orientation of the printed page using the ORIENTATION enumeration. 

ORIENTATION Enumeration

Description

PORTRAIT

Normal page orientation

LANDSCAPE

Page rotated landscape

Example: PrinterCE1.PrOrientation=PrinterCE.ORIENTATION.LANDSCAPE;

PrPaperSelection

Property: Returns / sets the paper selection for the printed page using PAPER_SELECTION enum: