c# PrintCE SDK dll 开发文档 无线 蓝牙 打印 A4纸 组件 原创

来源:互联网 发布:淘宝魔豆妈妈申请条件 编辑:程序博客网 时间:2024/04/27 22:17

 PrintCE SDK 开发文档 C#  无线 蓝牙 打印 组件

简体中文汉化组件下载 http://download.csdn.net/source/3420004


Graphic MODE printing:

1. For C/C++ programmers (eVC 3.0/4.0, MS Visual Studio 2005/2008)

1.1. Using set of functions PDC_ and corresponding to print functions for Win32
A C/C++ programmer acquainted with Win32 printing process can easily add printing to the program for Pocket PC. You can use this method in projects both including MFC or without MFC.

See Printing using PDC_ functions set for full details.

Note: See samples of projects using PDC_ print function set.

1.2. Using set of functions 'prn'.
This function set represents simplified approach to printing and allow developers non-acquainted with Win32 printing process to add printing function sparing their time.
You can use this method in projects both including MFC or without MFC. This method is the simplest one and the most preferable for projects of any grade of complexity.

See Printing using 'prn' functions set for full details.

Note: See samples of projects using 'prn' print function set.

2. For C# programmers (MS Visual Studio 2005/2008)

2.1. Using PrintCE SDK in MS Visual Studio 2005 /2008 for C#
A C# programmers can easily add printing to the program for .NET Compact Framework.

See using PrintCE SDK in your C# for .NET project for full details.

Note: See samples of projects.

3. For Visual Basic programmers (eVB 3.0, MS Visual Studio 2005/2008)

3.1. Using PrintCE SDK in eMbedded Visual Basic programs (eVB 3.0).
PrintCE.dll activates ActiveX control which is used for printing from eVB programs. Using ActiveX allows to easy adding to VB project of wide option range for text and graphic print management for WinCE.

See Printing using ActiveX control for full details.

Note: See samples of projects.

3.2. Using PrintCE SDK in MS Visual Studio 2005 / 2008 for Visual Basic.
A Visual Basic programmers can easily add printing to the program for .NET Compact Framework..

See using PrintCE SDK in your Visual Basic for .NET project for full details.

Note: See samples of projects.

 

TEXT MODE printing:

1. For C/C++ programmers (eVC 3.0/4.0, MS Visual Studio 2005/2008)

1.1. Using set of functions ASCII_
This function set represents simplified approach to printing into text mode. You can use this function set in projects both including MFC or without MFC.

See Printing using ASCII_ functions set for full details.

Note: See samples of projects using PDC_ print function set.

2. For C# programmers (MS Visual Studio 2005/2008)

2.1. Using PrintCE SDK in MS Visual Studio 2003 / 2005 /2008 for C#
A C# programmers can easily add text mode printing to the program for .NET Compact Framework.

See using PrintCE SDK in your C# for .NET project for full details.

Note: See samples of projects.

3. For Visual Basic programmers (eVB 3.0, MS Visual Studio 2005/2008)

3.1. Using PrintAscii ActiveX control in eMbedded Visual Basic programs.
PrintCE.dll activates ActiveX control which is used for printing from eVB programs. Using ActiveX allows to easy adding to VB project of wide option range for text and graphic print management for WinCE.

See Printing using PrintAscii ActiveX control for full details.

Note: See samples of projects.

3.2. Using PrintCE SDK in MS Visual Studio 2005 / 2008 for Visual Basic.
A Visual Basic programmers can easily add text mode printing to the program for .NET Compact Framework..

See using PrintCE SDK in your Visual Basic for .NET project for full details.

Note: See samples of projects.

 
 

Printing using PDC_ function set
Instruction for installation and used | Description functions

To use PrintCE in your C/C++ project you need to:

1. Copy PrintCE.dll to the \Windows\ directory on Pocket PC.
      you can use PrintCEDriver.arm.cab, PrintCEDriver.sh3.cab, PrintCEDriver.mips.cab for installation of PrintCE.dll or run PrintCEDriverPocketPC.exe or
PrintCEDriverWinCE.exe for automatic install from Desktop PC to Pocket PC/WinCE device.

2. Copy PrintCE.h in the directory with your project

3. Add line #include "PrintCE.h" in the code where PrintCE is supposed to be used.

4. PrintCE.h contains LoadPrintLib() function which performs explicit linking PrintCE.DLL. You should call this function before calling any other function from the library.
LoadPrintLib() returns TRUE if dll is found and FALSE if otherwise. To unload the library, use UnloadPrintLib().

Printing standard procedure includes steps as follows:

1. Load printing library LoadPrintLib().

if( LoadPrintLib() == FALSE ) {
      AfxMessageBox(_T("PrintCE.dll not Found"));
      return;
}

2. Initialization of printing library PDC_Init(_T("License key"))

// library initialization (licence key is transfered as a parameter)
PDC_Init(_T("Demo"));

3. Open 揚rint Setup?PDC_PrintDlg() or PDC_PageSetupDlg()

// show print setup dialog

PRINTDLG pdlg;

memset(&pdlg, 0, sizeof(PRINTDLG));
pdlg.cbStruct = sizeof(PRINTDLG);
pdlg.hwndOwner = hOwner;
pdlg.dwFlags = PD_INTHOUSANDTHSOFINCHES; // measuring units - inches

PDC_PrintDlg(&pdlg);

4. Get printer device context PDC_GetPrinterDC()

// get printer DC

HDC prnDC;

prnDC = PDC_GetPrinterDC();

5. Get parameters of printer device context for correct positioning of print elements PDC_GetDeviceCaps()

// get printer dpiX, dpiY, margins m_left, m_right, m_top, m_bottom
// and page sizes width, height in pixels

int dpiX, dpiY, width, height, m_left, m_right, m_top, m_bottom;
RECT page_rc;

dpiX = PDC_GetDeviceCaps(prnDC, LOGPIXELSX);
dpiY = PDC_GetDeviceCaps(prnDC, LOGPIXELSY);

m_left = (pdlg.rcMargin.left * dpiX)/1000;
m_right = (pdlg.rcMargin.right * dpiX)/1000;
m_top = (pdlg.rcMargin.top * dpiY)/1000;
m_bottom = (pdlg.rcMargin.bottom * dpiY)/1000;
width = PDC_GetDeviceCaps(prnDC, PHYSICALWIDTH) - (m_left + m_right);
height = PDC_GetDeviceCaps(prnDC, PHYSICALHEIGHT) - (m_top + m_bottom);

6. Start printing document PDC_StartDoc()

// start printing document

DOCINFO di;

memset(&di, 0, sizeof(DOCINFO));
di.cbSize = sizeof(DOCINFO);

PDC_StartDoc(prnDC, &di);

7. Print pages (the following steps should be taken for each of the pages:)

7.1. Start printing page PDC_StartPage()

PDC_StartPage(prnDC);

7.2. Print elements using set of functions

API CreatePen(), CreateSolidBrush(), CreateFontIndirect(), LoadBitmap(), etc.
or corresponding MFC
and set of functions PrintCE
PDC_SelectObject(), PDC_BitBlt(), PDC_DrawText(), PDC_Polyline(), PDC_Rectangle() etc.

// create pens of 0.01 (black) inches in width
HPEN hPenBlack;
hPenBlack = CreatePen(PS_SOLID, (int)(0.01 * dpiX), RGB(0,0,0));

// create red brushes
HBRUSH hBrushRed;
hBrushRed = CreateSolidBrush(RGB(255,0,0));

PDC_SelectObject(prnDC, hBrushRed);
PDC_SelectObject(prnDC, hPenBlack);

// draw Ellips 5x10 inch
PDC_Ellipse(prnDC, m_left, m_top, 5*dpiX, 10*dpiY);

7.3. End printing page PDC_EndPage()

PDC_EndPage(prnDC);

8. End printing document PDC_EndDoc()

PDC_EndDoc(prnDC);

9. Deinitialization of printing library PDC_UnInit()

PDC_UnInit();

10. Unload printing library UnloadPrintLib()

UnloadPrintLib();


Full set of PDC_ print functions exported from PrintCE.Dll :

Initialization Methods

MethodDescriptionPDC_InitInitialization of libraryPDC_UnInitDeinitialization of libraryPDC_PrintDlgThis function displays Print Setup dialog boxPDC_PageSetupDlgThis function is replacement for PDC_PrintDlg . It displays Print Setup dialog box.PDC_SilentPrintSetupThis function allows to set up printing without a printing dialog.PDC_SetAbortProcThis function sets the application-defined function that allows a print job to be cancelledduring printing.PDC_SetSilentModeThis function controls (permits or prohibits) presentation of a current printing statement window.PDC_SetPDFFileThis function allows to set output PDF file path.PDC_SetLanguageThis function sets language of the user interface.PDC_SetPrnParamThis function sets specific printer and port settings.

Print Info

MethodDescriptionPDC_GetVersionReturns current version of PrintCEPDC_GetCurrentSetupThis function allows to get the current settings of printing.PDC_GetStateThis function allows to get the current statement of a printing driver.PDC_IsConnectionThis function is a simplified version of the PDC_GetState.PDC_GetSentBytesThis function allows to get a number of bytes sent to printer.

Printer/Device Escape Methods

MethodDescriptionPDC_StartDocThis function starts a print jobPDC_EndDocThis function ends a print jobPDC_StartPageThis function prepares the printer driver to accept dataPDC_EndPageThis function informs the device that the application has finished writing to a page

Device Context Methods

MethodDescriptionPDC_GetPrinterDCReturns printer DC (Device Context).PDC_CreateCompatibleDCCreates a memory device context (DC) compatible with the specified printer device context.PDC_GetDeviceCapsRetrieves information about the capabilities of a printer device. PDC_DeleteDCDeletes the specified printer or memory device context

Type-Safe Selection Methods

MethodDescriptionPDC_SelectObjectThis function selects an object (HFONT, HBRUSH, HPEN, HBITMAP, or HDIBSECTION) into a printer device context

Drawing-Attribute Methods

MethodDescriptionPDC_SetBkColorSets the current background color to the specified color.PDC_SetBkModeSets the background mix mode of the specified printer device context.PDC_SetROP2Sets the current foreground mix mode. Foreground mix mode used to combine pens and interiors of filled objects with the colors already on the screen.PDC_SetTextColorSets the text color of the specified printer device context.

Line-Output Methods

MethodDescriptionPDC_DrawLineDraws a line using the current pen.PDC_PolylineDraws a series of line segments by connecting the points in the specified array.

Simple Drawing Methods

MethodDescriptionPDC_RectangleDraws a rectangle.PDC_RoundRectDraws a rectangle with rounded corners.

Ellipse Methods

MethodDescriptionPDC_EllipseDraws an ellipse

Bitmap Methods

MethodDescriptionPDC_BitBltTransfers pixels from a specified source rectangle to a specified destination rectangle, altering the pixels according to the selected raster operation (ROP) codePDC_StretchBltCopies a bitmap from a source rectangle into a destination rectangle, stretching or compressing the bitmap to fit the dimensions of the destination rectangle, if necessary.

Text Methods

PDC_DrawTextDraws formatted text in the specified rectangle.PDC_DrawTextFlowFlows text on the page.PDC_GetTextFlowHeightReturns height of text.PDC_ExtTextOutDraws a character string by using the currently selected font. An optional rectangle may be provided, to be used for clipping, opaquing, or both.PDC_GetTextExtentPointComputes the width and height of the specified string of text.PDC_GetTextExtentExPointRetrieves the number of characters in a specified string that will fit within a specified space and fills an array with the text extent for each of those characters. PDC_GetTextMetricsFills the specified buffer with the metrics for the currently selected font.

Barcode Methods

PDC_Draw2OF5Draws Interleaved 2 of 5 type barcode.PDC_DrawCodaBarDraws Codabar type barcode.PDC_DrawCode39Draws Code 39 type barcode.PDC_DrawCode93Draws Code 93 type barcode. PDC_DrawCode128Draws Code 128 type barcode.PDC_DrawEAN8Draws EAN-8 type barcodePDC_DrawEAN13Draws EAN-13 type barcodePDC_DrawMSIDraws MSI type barcodePDC_DrawPostnetDraws Postnet type barcodePDC_DrawUCC128Draws UCC 128 type barcodePDC_DrawUPCADraws UPC-A type barcodePDC_DrawUPCEDraws UPC-E type barcodePDC_DrawPDF417Draws PDF417 type barcodePDC_SetBarCodeHeightSets height of the bar codePDC_SetBarCodeScaleSets scale factor of the bar codePDC_SetBarCodeAngleSets rotation angle of the bar code

Printing using 'prn' function set
Instruction for installation and used | Description functions

To use PrintCE in your C/C++ project you need to:

1. Copy PrintCE.dll to the \Windows\ directory
      you can use PrintCEDriver.arm.cab, PrintCEDriver.sh3.cab, PrintCEDriver.mips.cab for installation of PrintCE.dll or run PrintCEDriver.exe for automatic install from Desktop PC to Pocket PC/WinCE.

2. Copy PrintCE.h in the directory with your project

3. Add line #include "PrintCE.h" in the code where PrintCE is supposed to be used.

4. PrintCE.h contains LoadPrintLib() function which performs explicit linking PrintCE.DLL.
You should call this function before calling any other function from the library.
LoadPrintLib() returns TRUE is dll is found and FALSE if otherwise.
To unload the library use UnloadPrintLib().

 

Printing standard procedure includes steps as follows:

1. Load printing library LoadPrintLib().

if( LoadPrintLib() == FALSE ) {
      AfxMessageBox(_T("PrintCE.dll not Found"));
      return;
}

2. Initialization of printing library prnInit (_T("License key"))

// library initialization (licence key is transfered as a parameter)

prnInit(_T("Demo"));

3. Open 揚rint Setup?prnSetupDlg()

// switch measuring units to inches
prnSetMeasureUnit(kInches);

// show print setup dialogue
prnSetupDlg(m_hWnd);

4. Start printing document prnStartDoc()

// start printing document
prnStartDoc();

5. Print pages (the following steps should be taken for each of the pages:)

5.1. Start printing page prnStartPage ()

// start printing page
prnStartPage();

5.2. Print elements using set of 憄rn?functions prnSetFontSize(), prnSetTextColor(), prnDrawText (), prnDrawLine(), prnDrawRect(), etc.

// print heading with font of 14 points in height, bold

prnSetFontName(_T("Tahoma"));
prnSetFontSize(14.0);
prnSetFontBold(TRUE);
prnDrawAlignedText(_T("Hello World"), prnGetPageWidth()/2, 0, hCenter, vTop);

6. End printing document prnEndDoc()

// end printing document
prnEndDoc();

7. Deinitialization of printing library prnUnInit()

// library deinitialization
prnUnInit();

8. Unload printing library UnloadPrintLib()

UnloadPrintLib();


Full set of 憄rn?print functions exported from PrintCE.Dll

Initialization

MethodDescriptionprnInitInitialization of library.prnUnInitDeinitialization of library.prnSetupDlgThis function displays Print Setup dialog box.prnStartDocThis function starts a print job.prnEndDocThis function ends a print jobprnStartPageThis function prepares the printer driver to accept dataprnSilentPrintSetupThis function allows to set up printing without a printing dialog.prnSetAbortProcThis function sets the application-defined function that allows a print job to be cancelledduring printing.prnSetSilentModeThis function controls (permits or prohibits) presentation of a current printing statement window.prnSetPDFFileThis function allows to set output PDF file path.prnSetLanguageThis function sets language of the user interface.prnSetPrnParamThis function sets specific printer and port settings.

Print info

MethodDescriptionprnGetVersionReturns current version of PrintCEprnGetCurrentSetupThis function allows to get the current settings of printing.prnGetStateThis function allows to get the current statement of a printing driver.prnIsConnectionThis function is a simplified version of the prnGetState.prnGetSentBytesThis function allows to get a number of bytes sent to printer.

Text Functions

MethodDescriptionprnDrawTextThe function draws a textprnDrawText2This function draws a text with the selected colourprnDrawTextFlowThe function flows text on the pageprnGetTextFlowHeightThe function returns height of textprnDrawAlignedTextThe function draws a text horizontally and vertically aligned

Ellipse Functions

MethodDescriptionprnDrawEllipseThis function draws an ellipseprnDrawCircleThe function draws a circle of the selected radius

Line-Polygon Functions

MethodDescriptionprnDrawLineThe function draws a lineprnDrawRectThe function draws a rectangleprnDrawSolidRectThe function draws a rectangle filled with the selected colourprnDrawRoundRectThe function draws a rectangle with rounded corners

Bitmap Functions

MethodDescriptionprnDrawPictureThe function draws JPG or BMP fileprnGetPictureSizeThe function returns size of the picture in the JPG or BMP fileprnDrawBitmapThe function draws HBITMAP

Convert Function

MethodDescriptionprnConvertValueThe function transfers values from one measurement unit to anotherprnConvertValueXThe function transfers values from one measurement unit to another (for the X axis)prnConvertValueYThe function transfers values from one measurement unit to another (for the Y axis)

Drawing-Attribute

MethodDescriptionprnSetMeasureUnitThe function sets the current measurement unit for coordinatesprnGetMeasureUnitThe function returns the current measurement unit for coordinatesprnSetLineWidthThe function sets width of the line used for printing of rectangles, ellipses, lines and so onprnGetLineWidthThe function returns width of the line used for printing of rectangles, ellipses, lines and so onprnSetLineColorThe function sets colour of the line used for printing of rectangles, ellipses, lines and so onprnGetLineColorThe function returns colour of the line used for printing of rectangles, ellipses, lines and so onprnSetFillColorThe function sets colour of the filling used for printing of rectangles, ellipses and so onprnGetFillColorThe function returns colour of the filling used for printing of rectangles, ellipses and so onprnSetFillStyleThe function sets pattern of the filling used for printing of rectangles, ellipses and so onprnGetFillStyleThe function returns pattern of the filling used for printing of rectangles, ellipses and so onprnSetTextColorThe function sets colour of the text for printingprnGetTextColorThe function returns colour of the textprnSetTransparentTextBgrThis function sets the background mode of the text used by functions prnDrawText(), prnDrawAlignedText() and prnDrawText2()prnSetTextHorAlignThis function sets a value that determines the horizontal justification used by functions prnDrawText() and prnDrawText2()prnSetTextVertAlignThis function sets a value that determines the vertical justification used by functions prnDrawText() and prnDrawText2()

Font Functions

MethodDescriptionprnSetFontNameThe function sets name of the fontprnGetFontNameThe function returns name of the fontprnSetFontSizeThe function sets size of the font (in points)prnSetFontSize2The function sets size of the font used in measurement unitprnGetFontSizeThe function returns font size in pointsprnGetFontSize2The function returns font size in the selected measurement unitsprnSetFontBoldThe function sets width of the fontprnGetFontBoldThe function returns width of the fontprnSetFontItalicThe function sets typeface ItalicprnGetFontItalicThe function returns typeface ItalicprnSetFontStrikeThe function sets the font style strokedprnGetFontStrikeThe function returns the font style strpkedprnSetFontUnderlineThe function sets the font style UnderlineprnGetFontUnderlineThe function returns the font style UnderlineprnGetTextHeightThe function returns height of the text in the current unitsprnGetTextWidthThe function returns width of the text in the current unitsprnGetFontAngleThe function returns rotation angle of the font in degree prnSetFontAngleThe functionsets rotation angle of the font in degree

Page Atribute

MethodDescriptionprnGetPageHeightThe function returns height of the page in the current unitsprnGetPageWidthThe function returns width of the page in the current unitsprnGetLeftMarginThe function returns left margin on the page in the current measurement unitsprnSetLeftMarginThe function set left margin on the page in the current measurement unitsprnGetRightMarginThe function returns right margin on the page in the current measurement unitsprnSetRightMarginThe function set right margin on the page in the current measurement unitsprnGetTopMarginThe function returns upper margin on the page in the current measurement unitsprnSetTopMarginThe function set upper margin on the page in the current measurement unitsprnGetBottomMarginThe function returns lower margin on the page in the current measurement unitsprnSetBottomMarginThe function set lower margin on the page in the current measurement units

Barcode Methods

prnDraw2OF5Draws Interleaved 2 of 5 type barcode.prnDrawCodaBarDraws Codabar type barcode.prnDrawCode39Draws Code 39 type barcode.prnDrawCode93Draws Code 93 type barcode. prnDrawCode128Draws Code 128 type barcode.prnDrawEAN8Draws EAN-8 type barcodeprnDrawEAN13Draws EAN-13 type barcodeprnDrawMSIDraws MSI type barcodeprnDrawPostnetDraws Postnet type barcodeprnDrawUCC128Draws UCC 128 type barcodeprnDrawUPCADraws UPC-A type barcodeprnDrawUPCEDraws UPC-E type barcodeprnDrawPDF417Draws PDF417 type barcodeprnSetBarCodeHeightSets height of the bar codeprnSetBarCodeScaleSets scale factor of the bar codeprnSetBarCodeAngleSets rotation angle of the bar code

 

Printing using ASCII_ function set
Instruction for installation and used | Description functions

To use PrintCE in your C/C++ project you need to:

1. Copy PrintCE.dll to the \Windows\ directory on Pocket PC.
      you can use PrintCEDriver.arm.cab, PrintCEDriver.sh3.cab, PrintCEDriver.mips.cab for installation of PrintCE.dll or run PrintCEDriverPocketPC.exe or
PrintCEDriverWinCE.exe for automatic install from Desktop PC to Pocket PC/WinCE device.

2. Copy AsciiCE.h in the directory with your project

3. Add line #include "AsciiCE.h" in the code where ASCII_ functionsis supposed to be used.

4. AsciiCE.h contains LoadAsciiLib() function which performs explicit linking PrintCE.DLL. You should call this function before calling any other function from the library.
LoadAciiLib() returns TRUE if dll is found and FALSE if otherwise. To unload the library, use UnloadAsciiLib().

Printing standard procedure includes steps as follows:

1. Load printing library LoadAsciiLib().

if( LoadAsciiLib() == FALSE ) {
      AfxMessageBox(_T("PrintCE.dll not Found"));
      return;
}

2. Initialization of printing library ASCII_Init(_T("License key"))

// library initialization (licence key is transfered as a parameter)
ASCII_Init(_T("Demo"));

3. Connect to printer

// connect to printer
ASCII_Connect(port, port_param);

4. Send data to printer

// send string
ASCII_SendString(str);

// send char
ASCII_SendChar(ch);

// send array of bytes
ASCII_SendArray(byte_array, array_len);

5. Disconnect

ASCII_Disconnect();

9. Deinitialization of printing library ASCII_UnInit()

ASCII_UnInit();

10. Unload printing library UnloadAsciiLib()

UnloadAsciiLib();


Full set of ASCII_ print functions exported from PrintCE.Dll :

Initialization Methods

MethodDescriptionASCII_InitInitialization of libraryASCII_UnInitDeinitialization of libraryASCII_SetComPortParamSet COM port parametersASCII_SetLanguageThis function sets language of the user interfaceASCII_SetupPortThis function displays Port Setup dialog box

Print Info

MethodDescriptionASCII_GetVersionReturns current version of libraryASCII_GetStateThis function allows to get the current statement of a printing driver.ASCII_GetSentBytesThis function allows to get a number of bytes sent to printer.

Connect/Disconnect

MethodDescriptionASCII_ConnectConnect to printerASCII_ConnectSilentConnect to printer (prohibits presentation of a current printing statement window)ASCII_DisconnectClose connection

Send data

MethodDescriptionASCII_SendStringThis function allows to send string to printerASCII_SendCharThis function allows to send single character (byte) to printerASCII_SendArray This function allows to send array of bytes to printer

 


 

Printing using PrintCE ActiveX control
Instruction for Visual Basic (eVB 3.0) | Description functions

To use PrintCE ActiveX control in your Embedded Visual Basic (eVB 3.0) project you need to:

1. Click Start->Run on Desktop PC and type "regsvr32 Path\Desktop\PrintCE.dll". Path is PrintCE SDK files location. Sample: regsvr32 C:\Inesoft PrintCE SDK\eVB\PocketPC\Desktop\PrintCE.dll

2. Add PrintCE.bas file into your project. This file contains some predefined constants.

3. In eVB, select Tools -> Remote Tools -> Control Manager.

4. Expand element (click on the "+") corresponding to your device platform (ie Pocket PC 2002, Pocket PC, etc). You'll see three child elements: Emulation, Device and Desktop.

5. Selecting them one after another, perform the following actions for each of them: select "Control" menu -> Add New Control, in the opening window state path to PrintCE.DLL version corresponding to current platfirm (for Emulation - X86Em\PrintCE.dll, for Device element - select PrintCE.DLL corresponding to your PocketPC processor, Desktop Design Contor - select Desktop\PrintCE.dll) and press "Open".

All PrintCE.dll files is PrintCE SDK/eVB directory location.

6. You can use CreateObject() in your eVB code to create the PrintCE control or you can add the control to your control bar by selecting Project->Components and checking PrintCE. Then place the control on your form (it will be invisible at run-time) and start using it.

If you distribute PrintCE.dll with your program, you need to add registration of PrintCE.dll in .inf file for CabWizard (see VC help: "Creating an .inf File for the CAB Wizard" -> [DefaultInstall] section -> CESelfRegister) or see Example CAB


Description of methods and properties of PrintCE ActiveX control :

Initialization

Method
Methods or Properties
DescriptionInit
Method
Initialization of libraryUnInit
Method
Deinitialization of library.SetupDlg
Method
Displays Print Setup dialog box.StartDoc
Method
Starts a print job.EndDoc
Method
Ends a print jobStartPage
Method
Prepares the printer driver to accept dataSilentSetup
Method
Set up printing without a printing dialog.Silent
Property
Controls (permits or prohibits) presentation of a current printing statement window.PDFFile
Property
Sets output PDF file path.Language
Property
Sets language of the user interface.

Print info

Method
Methods or Properties
DescriptionVersion
Property
Current version of PrintCE driverGetCurrentSetup
Method
Allows to get the current settings of printing.State
Property
Current statement of a printing driver.Connection
Property
Current statement of a connection.SentBytes
Property
Number of bytes sent to printer.

Text Functions

Method
Methods or Properties
DescriptionDrawText
Method
Draws a textDrawText2
Method
Draws a text with the selected colourDrawTextFlow
Method
Flows text on the pageGetTextFlowHeight
Method
Returns height of textDrawAlignedText
Method
Draws a text horizontally and vertically aligned

Ellipse Functions

Method
Methods or Properties
DescriptionDrawEllipse
Method
Draws an ellipseDrawCircle
Method
Draws a circle of the selected radius

Line-Polygon Functions

Method
Methods or Properties
DescriptionDrawLine
Method
Draws a lineDrawRect
Method
Draws a rectangleDrawSolidRect
Method
Draws a rectangle filled with the selected colourDrawRoundRect
Method
Draws a rectangle with rounded corners

Bitmap Functions

Method
Methods or Properties
DescriptionDrawPicture
Method
Draws JPG or BMP fileGetPictureSize
Method
Returns size of the picture in the JPG orBMP file

Convert Function

Method
Methods or Properties
DescriptionConvertValue
Method
Transfers values from one measurement unit to another

Drawing-Attribute

Method
Methods or Properties
DescriptionMeasureUnit
Property
Current measurement unit for coordinatesLineWidth
Property
Width of the line used for printing of rectangles, ellipses, lines and so onLineColor
Property
Colour of the line used for printing of rectangles, ellipses, lines and so onFillColor
Property
Colour of the filling used for printing of rectangles, ellipses, lines and so onFillStyle
Property
Pattern of the filling used for printing of rectangles, ellipses and so onTextColor
Property
Colour of the text used by functions DrawText(), DrawAlignedText() for printingTransparentTextBgr
Property
Background mode of the text used by functions DrawText(), DrawAlignedText() and DrawText2()TextHorAlign
Property
Value that determines the horizontal justification used by functions DrawText() and DrawText2()TextVertAlign
Property
Value that determines the vertical justification used by functions DrawText() and DrawText2()

Font Functions

Method
Methods or Properties
DescriptionFontName
Property
Name of the font used by functions DrawText(), DrawText2, DrawAlignedText() for printingFontSize
Property
Size of the font (in points) used by functions DrawText(), DrawText2, DrawAlignedText() for printingSetFontSize2
Method
Sets size of the font used by the functions DrawText(), DrawText2, DrawAlignedText() for printing in the selected unitsGetFontSize2
Method
Returns font size in the selected measurement unitsFontBold
Property
Returns and sets the Bold font styleFontItalic
Property
Returns and sets the Italic font styleFontStrike
Property
Returns and sets the Strikeout font styleFontUnderline
Property
Returns and sets the Underline font styleGetTextHeight
Method
Returns height of the text in the current unitsGetTextWidth
Method
Returns width of the text in the current units

Page Atribute

Method
Methods or Properties
DescriptionPageHeight
Property
Returns height of the page in the current unitsPageWidth
Property
Returns width of the page in the current unitsLeftMargin
Property
Left margin on the page in the current measurement unitsRightMargin
Property
Right margin on the page in the current measurement unitsTopMargin
Property
Top margin on the page in the current measurement unitsBottomMargin
Property
Bottom margin on the page in the current measurement units

Barcode Methods

Method
Methods or Properties
DescriptionDraw2OF5
Method
Draws Interleaved 2 of 5 type barcode.DrawCodaBar
Method
Draws Codabar type barcode.DrawCode39
Method
Draws Code 39 type barcode.DrawCode93
Method
Draws Code 93 type barcode. DrawCode128
Method
Draws Code 128 type barcode.DrawEAN8
Method
Draws EAN-8 type barcodeDrawEAN13
Method
Draws EAN-13 type barcodeDrawMSI
Method
Draws MSI type barcodeDrawPostnet
Method
Draws Postnet type barcodeDrawUCC128
Method
Draws UCC 128 type barcodeDrawUPCA
Method
Draws UPC-A type barcodeDrawUPCE
Method
Draws UPC-E type barcodeBarcodeHeight
Property
Height of the bar code

 


Printing using PrintAscii ActiveX control
Instruction for Visual Basic (eVB 3.0) | Description functions

To use PrintAscii ActiveX control in your Embedded Visual Basic (eVB 3.0) project you need to:

1. Click Start->Run on Desktop PC and type "regsvr32 Path\Desktop\PrintCE.dll". Path is PrintCE SDK files location. Sample: regsvr32 C:\Inesoft PrintCE SDK\eVB\PocketPC\Desktop\PrintCE.dll

2. Add PrintCE.bas file into your project. This file contains some predefined constants.

3. In eVB, select Tools -> Remote Tools -> Control Manager.

4. Expand element (click on the "+") corresponding to your device platform (ie Pocket PC 2002, Pocket PC, etc). You'll see three child elements: Emulation, Device and Desktop.

5. Selecting them one after another, perform the following actions for each of them: select "Control" menu -> Add New Control, in the opening window state path to PrintCE.DLL version corresponding to current platform (for Emulation - X86Em\PrintCE.dll, for Device element - select PrintCE.DLL corresponding to your PocketPC processor, Desktop Design Contor - select Desktop\PrintCE.dll) and press "Open".

All PrintCE.dll files is PrintCE SDK/eVB directory location.

6. You can use CreateObject() in your eVB code to create the PrintAscii control or you can add the control to your control bar by selecting Project->Components and checking PrintAscii. Then place the control on your form (it will be invisible at run-time) and start using it.

If you distribute PrintCE.dll with your program, you need to add registration of PrintCE.dll in .inf file for CabWizard (see VC help: "Creating an .inf File for the CAB Wizard" -> [DefaultInstall] section -> CESelfRegister) or see Example CAB


Description of methods and properties of PrintAscii ActiveX control :

Initialization

Method
Methods or Properties
DescriptionInit
Method
Initialization of libraryUnInit
Method
Deinitialization of library.SetComPortParam
Method
Set COM port parameters.

Print Info

Method
Methods or Properties
DescriptionVersion
Property
Current version of libraryState
Property
Current statement of a printing driver.SentBytes
Property
Number of bytes sent to printer.

Connect/Disconnect

Method
Methods or Properties
DescriptionConnect
Method
Connect to printerDisconnect
Method
Close connection

Send data

Method
Methods or Properties
DescriptionSendString
Method
Send string to printerSendChar
Method
Send single character (byte) to printer

 


Printing using PrintCE SDK for Visual Studio 2005 & 2008 .NET

To use PrintCE SDK in your C# project you need to:

1. Copy PrintCE.dll to the \Windows\ directory
      use PrintCEDriver.arm.cab, PrintCEDriver.sh3.cab, PrintCEDriver.mips.cab for installation of PrintCE.dll or run PrintCEDriver.exe for automatic install from Desktop PC to Pocket PC/WinCE.

2. Copy PrintCE.cs in the directory with your project

3. Add PrintCE.cs to your project (menu "Project/Add existing item...")

4. Add line using PrintCENET; in the code where PrintCE is supposed to be used.

5. Create PrintCE class for graphic mode printing or PrintASCII class for text mode printing

PrintCE print1 = null;

print1 = new PrintCE();

or

PrintASCII print1 = null;

print1 = new PrintASCII();

For details see description of methods and properties of PrintCE .NET control and PrintAscii .NET control

If you distribute PrintCE.dll with your program, you need to add registration of PrintCE.dll in .inf file for CabWizard (please refer to VC help: "Creating an .inf File for the CAB Wizard" -> [DefaultInstall] section -> CESelfRegister) or see Example CAB

To use PrintCE SDK in your Visual Basic for .NET project you need to:

1. Copy PrintCE.dll to the \Windows\ directory
      use PrintCEDriver.arm.cab, PrintCEDriver.sh3.cab, PrintCEDriver.mips.cab for installation of PrintCE.dll or run PrintCEDriver.exe for automatic install from Desktop PC to Pocket PC/WinCE.

2. Copy PrintCE.vb in the directory with your project

3. Add PrintCE.vb to your project (menu "Project/Add existing item...")

4. Create PrintCE class for graphic mode printing or PrintASCII class for text mode printing.

Dim print1 As PrintCE

print1 = New PrintCE

or

Dim print1 As PrintASCII

print1 = New PrintASCII

For details see description of methods and properties of PrintCE .NET control and PrintAscii .NET control

If you distribute PrintCE.dll with your program, you need to add registration of PrintCE.dll in .inf file for CabWizard (please refer to VC help: "Creating an .inf File for the CAB Wizard" -> [DefaultInstall] section -> CESelfRegister) or see Example CAB

 


Description of methods and properties of PrintCE .NET control :

Initialization

Method
Methods or Properties
DescriptionInit
Method
Initialization of libraryUnInit
Method
Deinitialization of library.SetupDlg
Method
Displays Print Setup dialog box.StartDoc
Method
Starts a print job.EndDoc
Method
Ends a print jobStartPage
Method
Prepares the printer driver to accept dataSilentPrintSetup
Method
Set up printing without a printing dialog.SilentMode
Property
Controls (permits or prohibits) presentation of a current printing statement window.PDFFile
Property
Sets output PDF file path.Language
Property
Sets language of the user interface.SetPrnParam
Method
Sets specific printer and port settings.

Print info

Method
Methods or Properties
DescriptionVersion
Property
Current version of PrintCE driverGetCurrentSetup
Method
Allows to get the current settings of printing.State
Property
Current statement of a printing driver.Connection
Property
Current statement of a connection.SentBytes
Property
Number of bytes sent to printer.

Text Functions

Method
Methods or Properties
DescriptionDrawText
Method
Draws a textDrawText2
Method
Draws a text with the selected colourDrawTextFlow
Method
Flows text on the pageGetTextFlowHeight
Method
Returns height of textDrawAlignedText
Method
Draws a text horizontally and vertically aligned

Ellipse Functions

Method
Methods or Properties
DescriptionDrawEllipse
Method
Draws an ellipseDrawCircle
Method
Draws a circle of the selected radius

Line-Polygon Functions

Method
Methods or Properties
DescriptionDrawLine
Method
Draws a lineDrawRect
Method
Draws a rectangleDrawSolidRect
Method
Draws a rectangle filled with the selected colourDrawRoundRect
Method
Draws a rectangle with rounded corners

Bitmap Functions

Method
Methods or Properties
DescriptionDrawPicture
Method
Draws JPG or BMP fileDrawBitmap
Method
Draws BitmapGetPictureSize
Method
Returns size of the picture in the JPG orBMP file

Convert Function

Method
Methods or Properties
DescriptionConvertValue
Method
Transfers values from one measurement unit to another

Drawing-Attribute

Method
Methods or Properties
DescriptionMeasureUnit
Property
Current measurement unit for coordinatesLineWidth
Property
Width of the line used for printing of rectangles, ellipses, lines and so onLineColor
Property
Colour of the line used for printing of rectangles, ellipses, lines and so onFillColor
Property
Colour of the filling used for printing of rectangles, ellipses, lines and so onFillStyle
Property
Pattern of the filling used for printing of rectangles, ellipses and so onTextColor
Property
Colour of the text used by functions DrawText(), DrawAlignedText() for printingTransparentTextBgr
Property
Background mode of the text used by functions DrawText(), DrawAlignedText() and DrawText2()TextHorAlign
Property
Value that determines the horizontal justification used by functions DrawText() and DrawText2()TextVertAlign
Property
Value that determines the vertical justification used by functions DrawText() and DrawText2()

Font Functions

Method
Methods or Properties
DescriptionFontName
Property
Name of the font used by functions DrawText(), DrawText2, DrawAlignedText() for printingFontSize
Property
Size of the font (in points) used by functions DrawText(), DrawText2, DrawAlignedText() for printingFontBold
Property
Returns and sets the Bold font styleFontItalic
Property
Returns and sets the Italic font styleFontStrike
Property
Returns and sets the Strikeout font styleFontUnderline
Property
Returns and sets the Underline font styleFontAngle
Property
Returns and sets the rotation angle of the fontGetTextHeight
Method
Returns height of the text in the current unitsGetTextWidth
Method
Returns width of the text in the current units

Page Atribute

Method
Methods or Properties
DescriptionPageHeight
Property
Returns height of the page in the current unitsPageWidth
Property
Returns width of the page in the current unitsLeftMargin
Property
Left margin on the page in the current measurement unitsRightMargin
Property
Right margin on the page in the current measurement unitsTopMargin
Property
Top margin on the page in the current measurement unitsBottomMargin
Property
Bottom margin on the page in the current measurement units

Barcode Methods

Method
Methods or Properties
DescriptionDraw2OF5
Method
Draws Interleaved 2 of 5 type barcode.DrawCodaBar
Method
Draws Codabar type barcode.DrawCode39
Method
Draws Code 39 type barcode.DrawCode93
Method
Draws Code 93 type barcode. DrawCode128
Method
Draws Code 128 type barcode.DrawEAN8
Method
Draws EAN-8 type barcodeDrawEAN13
Method
Draws EAN-13 type barcodeDrawMSI
Method
Draws MSI type barcodeDrawPostnet
Method
Draws Postnet type barcodeDrawUCC128
Method
Draws UCC 128 type barcodeDrawUPCA
Method
Draws UPC-A type barcodeDrawUPCE
Method
Draws UPC-E type barcodeDrawPDF417
Method
Draws PDF417 type barcodeBarcodeHeight
Property
Height of the bar codeBarcodeScale
Property
Scale factor of the bar codeBarcodeAngle
Property
Rotation angle of the bar code

 


Description of methods and properties of PrintAscii .NET control :

Initialization

Method
Methods or Properties
DescriptionInit
Method
Initialization of libraryUnInit
Method
Deinitialization of library.SetComPortParam
Method
Set COM port parameters.Language
Property
Language of the user interface.SetupPort
Method
Displays Port Setup dialog box.

Print Info

Method
Methods or Properties
DescriptionVersion
Property
Current version of libraryState
Property
Current statement of a printing driver.SentBytes
Property
Number of bytes sent to printer.

Connect/Disconnect

Method
Methods or Properties
DescriptionConnect
Method
Connect to printerConnectSilent
Method
Connect to printer (prohibits presentation of a current printing statement window)Disconnect
Method
Close connection

Send data

Method
Methods or Properties
DescriptionSendString
Method
Send string to printerSendByte
Method
Send single byte (character) to printerSendBytes
Method
Send array of bytes to printer