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:
DrawTextFlow

Use DrawTextFlow to print a full page of text using the selected printer, paper and margins.

See full size printed output

 
//
// Print the contents of text onto page
// Note: for simplicity of this code, we assume "text" string to contain all text to be printed.
//

PrinterCE prce =
null;
try
{
  prce = new PrinterCE(); //Create instance of PrinterCE class
  prce.SelectPrinter(true);
  prce.PrOrientation = PrinterCE.ORIENTATION.PORTRAIT; //Force to portrait mode
  prce.ScaleMode = PrinterCE.MEASUREMENT_UNITS.INCHES; //Everything in inches
 
  //The following call automatically prints the entire contents of "text"
  //on full page using as many pages as necessary.
  int rlen=prce.DrawTextFlow(text);
  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;
}