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:
Hello World

Not much to look at, but this traditional "Hello World" program demonstrates the simplicity of using PrinterCE for .NetCF

See full size printed output

C# Source:

PrinterCE prce = null;
try
{
  prce =
new PrinterCE("YOURLICENSEKEY"); //No License Key for evaluation
 
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
   
// NOTE: Only call ShutDown if PrinterCE instance is about to be destroyed.
  }
 
prce=
null;
 
MessageBox.Show("PrinterCE Exception","Exception");
}
finally  //Need to always call ShutDown()
{
 
if (prce!=null)
  {
    prce.ShutDown();
//Done - free PrinterCE resources
    // NOTE: Only call ShutDown if PrinterCE instance
    // is about to be destroyed.

  }
  prce=
null
;
}

VB.Net Source:

Dim prce As PrinterCE
Try
  prce =
New PrinterCE("YOURLICENSEKEY")
' No License Key for evaluation
  prce.SelectPrinter(
True)
  prce.DrawText("Hello World")
  prce.EndDoc()
Catch exc As PrinterCEException
  MessageBox.Show("PrinterCE Exception", "Exception")
Finally
  prce.ShutDown()
  ' NOTE: Only call ShutDown if PrinterCE instance
  ' is about to be destroyed.

End Try