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

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
  PrintPocketCE
  PIEprint
  PocketPixPrint
  PocketShot
 
PocketClipPrint

Arcade Games
  SockOut
  MazeCraze

Contact Info

PrinterCE.NetCF Example:
Text Wheel

Demonstrates the ability to rotate text in 90 degree increments and change font colors, sizes & formats.

See full size printed output

 
PrinterCE prce = null;
try //Use
{
  prce = new PrinterCE(); //Create instance of PrinterCE class
  prce.ScaleMode = PrinterCE.MEASUREMENT_UNITS.INCHES; //Everything in inches
  prce.SelectPrinter(true);
  string str, orientstr;
  for (int lp=0; lp<4; lp++)
  {
    prce.TextX = prce.PrPgWidth / 2;
    prce.TextY = prce.PrPgHeight / 2;
    prce.FontBold = false;
    prce.FontItalic = false;
    prce.FontSize = 12;
    switch (lp)
    {
    case 1:
      prce.Rotation = PrinterCE.ROTATION_TYPE.EAST;
      str="East";
      break;
    case 2:
      prce.Rotation = PrinterCE.ROTATION_TYPE.SOUTH;
      str="South";
      break;
    case 3:
      prce.Rotation = PrinterCE.ROTATION_TYPE.WEST;
      str="West";
      break;
    default:
    case 0:
      prce.Rotation = PrinterCE.ROTATION_TYPE.NORTH;
      str="North";
      break;
    }
    orientstr = (prce.PrOrientation == PrinterCE.ORIENTATION.PORTRAIT) ? "Portrait" : "Landscape";
    prce.ForeColor = Color.Black; //Set color to black
    prce.DrawText("Hello " + str + " World - " + orientstr + " Orientation"); //position first line
    prce.DrawText("Each line of text is automatically positioned.");
    prce.FontSize = 24;
    prce.FontBold = true;
    prce.FontItalic = true;
    prce.ForeColor = Color.Magenta; //Set color
    prce.DrawText("Color, bold and italics");
    prce.FontSize = 16;
    prce.ForeColor = Color.Cyan; //Set color
    prce.DrawText("And last but not least...");
  }
  prce.EndDoc(); //Done with this page - print it
}
catch (PrinterCEException exc)
{
  if (prce!=null)
  {
    prce.ShutDown(); //Done - free PrinterCE resources
    // NOTE: Only call ShutDown if PrinterCE instance is about to be destroyed.
  }
  prce=null;
  MessageBox.Show("PrinterCE Exception","Exception");
}
finally
{
  if (prce!=null)
  {
    prce.ShutDown(); //Done - free PrinterCE resources
    // NOTE: Only call ShutDown if PrinterCE instance is about to be destroyed.
  }
  prce=null;
}