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