PrintCE SDK 开发文档 C# 无线 蓝牙 打印 组件
简体中文汉化组件下载 http://download.youkuaiyun.com/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
Method | Description |
PDC_Init | Initialization of library |
PDC_UnInit | Deinitialization of library |
PDC_PrintDlg | This function displays Print Setup dialog box |
PDC_PageSetupDlg | This function is replacement for PDC_PrintDlg . It displays Print Setup dialog box. |
PDC_SilentPrintSetup | This function allows to set up printing without a printing dialog. |
PDC_SetAbortProc | This function sets the application-defined function that allows a print job to be cancelledduring printing. |
PDC_SetSilentMode | This function controls (permits or prohibits) presentation of a current printing statement window. |
PDC_SetPDFFile | This function allows to set output PDF file path. |
PDC_SetLanguage | This function sets language of the user interface. |
PDC_SetPrnParam | This function sets specific printer and port settings. |
Print Info
Method | Description |
PDC_GetVersion | Returns current version of PrintCE |
PDC_GetCurrentSetup | This function allows to get the current settings of printing. |
PDC_GetState | This function allows to get the current statement of a printing driver. |
PDC_IsConnection | This function is a simplified version of the PDC_GetState. |
PDC_GetSentBytes | This function allows to get a number of bytes sent to printer. |
Printer/Device Escape Methods
Method | Description |
PDC_StartDoc | This function starts a print job |
PDC_EndDoc | This function ends a print job |
PDC_StartPage | This function prepares the printer driver to accept data |
PDC_EndPage | This function informs the device that the application has finished writing to a page |
Device Context Methods
Method | Description |
PDC_GetPrinterDC | Returns printer DC (Device Context). |
PDC_CreateCompatibleDC | Creates a memory device context (DC) compatible with the specified printer device context. |
PDC_GetDeviceCaps | Retrieves information about the capabilities of a printer device. |
PDC_DeleteDC | Deletes the specified printer or memory device context |
Type-Safe Selection Methods
Method | Description |
PDC_SelectObject | This function selects an object (HFONT, HBRUSH, HPEN, HBITMAP, or HDIBSECTION) into a printer device context |
Drawing-Attribute Methods
Method | Description |
PDC_SetBkColor | Sets the current background color to the specified color. |
PDC_SetBkMode | Sets the background mix mode of the specified printer device context. |
PDC_SetROP2 | Sets 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_SetTextColor | Sets the text color of the specified printer device context. |
Line-Output Methods
Method | Description |
PDC_DrawLine | Draws a line using the current pen. |
PDC_Polyline | Draws a series of line segments by connecting the points in the specified array. |
Simple Drawing Methods
Method | Description |
PDC_Rectangle | Draws a rectangle. |
PDC_RoundRect | Draws a rectangle with rounded corners. |
Ellipse Methods
Method | Description |
PDC_Ellipse | Draws an ellipse |
Bitmap Methods
Method | Description |
PDC_BitBlt | Transfers pixels from a specified source rectangle to a specified destination rectangle, altering the pixels according to the selected raster operation (ROP) code |
PDC_StretchBlt | Copies 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_DrawText | Draws formatted text in the specified rectangle. |
PDC_DrawTextFlow | Flows text on the page. |
PDC_GetTextFlowHeight | Returns height of text. |
PDC_ExtTextOut | Draws a character string by using the currently selected font. An optional rectangle may be provided, to be used for clipping, opaquing, or both. |
PDC_GetTextExtentPoint | Computes the width and height of the specified string of text. |
PDC_GetTextExtentExPoint | Retrieves 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_GetTextMetrics | Fills the specified buffer with the metrics for the currently selected font. |
Barcode Methods
PDC_Draw2OF5 | Draws Interleaved 2 of 5 type barcode. |
PDC_DrawCodaBar | Draws Codabar type barcode. |
PDC_DrawCode39 | Draws Code 39 type barcode. |
PDC_DrawCode93 | Draws Code 93 type barcode. |
PDC_DrawCode128 | Draws Code 128 type barcode. |
PDC_DrawEAN8 | Draws EAN-8 type barcode |
PDC_DrawEAN13 | Draws EAN-13 type barcode |
PDC_DrawMSI | Draws MSI type barcode |
PDC_DrawPostnet | Draws Postnet type barcode |
PDC_DrawUCC128 | Draws UCC 128 type barcode |
PDC_DrawUPCA | Draws UPC-A type barcode |
PDC_DrawUPCE | Draws UPC-E type barcode |
PDC_DrawPDF417 | Draws PDF417 type barcode |
PDC_SetBarCodeHeight | Sets height of the bar code |
PDC_SetBarCodeScale | Sets scale factor of the bar code |
PDC_SetBarCodeAngle | Sets 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
Method | Description |
prnInit | Initialization of library. |
prnUnInit | Deinitialization of library. |
prnSetupDlg | This function displays Print Setup dialog box. |
prnStartDoc | This function starts a print job. |
prnEndDoc | This function ends a print job |
prnStartPage | This function prepares the printer driver to accept data |
prnSilentPrintSetup | This function allows to set up printing without a printing dialog. |
prnSetAbortProc | This function sets the application-defined function that allows a print job to be cancelledduring printing. |
prnSetSilentMode | This function controls (permits or prohibits) presentation of a current printing statement window. |
prnSetPDFFile | This function allows to set output PDF file path. |
prnSetLanguage | This function sets language of the user interface. |
prnSetPrnParam | This function sets specific printer and port settings. |
Print info
Method | Description |
prnGetVersion | Returns current version of PrintCE |
prnGetCurrentSetup | This function allows to get the current settings of printing. |
prnGetState | This function allows to get the current statement of a printing driver. |
prnIsConnection | This function is a simplified version of the prnGetState. |
prnGetSentBytes | This function allows to get a number of bytes sent to printer. |
Text Functions
Method | Description |
prnDrawText | The function draws a text |
prnDrawText2 | This function draws a text with the selected colour |
prnDrawTextFlow | The function flows text on the page |
prnGetTextFlowHeight | The function returns height of text |
prnDrawAlignedText | The function draws a text horizontally and vertically aligned |
Ellipse Functions
Method | Description |
prnDrawEllipse | This function draws an ellipse |
prnDrawCircle | The function draws a circle of the selected radius |
Line-Polygon Functions
Method | Description |
prnDrawLine | The function draws a line |
prnDrawRect | The function draws a rectangle |
prnDrawSolidRect | The function draws a rectangle filled with the selected colour |
prnDrawRoundRect | The function draws a rectangle with rounded corners |
Bitmap Functions
Method | Description |
prnDrawPicture | The function draws JPG or BMP file |
prnGetPictureSize | The function returns size of the picture in the JPG or BMP file |
prnDrawBitmap | The function draws HBITMAP |
Convert Function
Method | Description |
prnConvertValue | The function transfers values from one measurement unit to another |
prnConvertValueX | The function transfers values from one measurement unit to another (for the X axis) |
prnConvertValueY | The function transfers values from one measurement unit to another (for the Y axis) |
Drawing-Attribute
Method | Description |
prnSetMeasureUnit | The function sets the current measurement unit for coordinates |
prnGetMeasureUnit | The function returns the current measurement unit for coordinates |
prnSetLineWidth | The function sets width of the line used for printing of rectangles, ellipses, lines and so on |
prnGetLineWidth | The function returns width of the line used for printing of rectangles, ellipses, lines and so on |
prnSetLineColor | The function sets colour of the line used for printing of rectangles, ellipses, lines and so on |
prnGetLineColor | The function returns colour of the line used for printing of rectangles, ellipses, lines and so on |
prnSetFillColor | The function sets colour of the filling used for printing of rectangles, ellipses and so on |
prnGetFillColor | The function returns colour of the filling used for printing of rectangles, ellipses and so on |
prnSetFillStyle | The function sets pattern of the filling used for printing of rectangles, ellipses and so on |
prnGetFillStyle | The function returns pattern of the filling used for printing of rectangles, ellipses and so on |
prnSetTextColor | The function sets colour of the text for printing |
prnGetTextColor | The function returns colour of the text |
prnSetTransparentTextBgr | This function sets the background mode of the text used by functions prnDrawText(), prnDrawAlignedText() and prnDrawText2() |
prnSetTextHorAlign | This function sets a value that determines the horizontal justification used by functions prnDrawText() and prnDrawText2() |
prnSetTextVertAlign | This function sets a value that determines the vertical justification used by functions prnDrawText() and prnDrawText2() |
Font Functions
Method | Description |
prnSetFontName | The function sets name of the font |
prnGetFontName | The function returns name of the font |
prnSetFontSize | The function sets size of the font (in points) |
prnSetFontSize2 | The function sets size of the font used in measurement unit |
prnGetFontSize | The function returns font size in points |
prnGetFontSize2 | The function returns font size in the selected measurement units |
prnSetFontBold | The function sets width of the font |
prnGetFontBold | The function returns width of the font |
prnSetFontItalic | The function sets typeface Italic |
prnGetFontItalic | The function returns typeface Italic |
prnSetFontStrike | The function sets the font style stroked |
prnGetFontStrike | The function returns the font style strpked |
prnSetFontUnderline | The function sets the font style Underline |
prnGetFontUnderline | The function returns the font style Underline |
prnGetTextHeight | The function returns height of the text in the current units |
prnGetTextWidth | The function returns width of the text in the current units |
prnGetFontAngle | The function returns rotation angle of the font in degree |
prnSetFontAngle | The functionsets rotation angle of the font in degree |
Page Atribute
Method | Description |
prnGetPageHeight | The function returns height of the page in the current units |
prnGetPageWidth | The function returns width of the page in the current units |
prnGetLeftMargin | The function returns left margin on the page in the current measurement units |
prnSetLeftMargin | The function set left margin on the page in the current measurement units |
prnGetRightMargin | The function returns right margin on the page in the current measurement units |
prnSetRightMargin | The function set right margin on the page in the current measurement units |
prnGetTopMargin | The function returns upper margin on the page in the current measurement units |
prnSetTopMargin | The function set upper margin on the page in the current measurement units |
prnGetBottomMargin | The function returns lower margin on the page in the current measurement units |
prnSetBottomMargin | The function set lower margin on the page in the current measurement units |
Barcode Methods
prnDraw2OF5 | Draws Interleaved 2 of 5 type barcode. |
prnDrawCodaBar | Draws Codabar type barcode. |
prnDrawCode39 | Draws Code 39 type barcode. |
prnDrawCode93 | Draws Code 93 type barcode. |
prnDrawCode128 | Draws Code 128 type barcode. |
prnDrawEAN8 | Draws EAN-8 type barcode |
prnDrawEAN13 | Draws EAN-13 type barcode |
prnDrawMSI | Draws MSI type barcode |
prnDrawPostnet | Draws Postnet type barcode |
prnDrawUCC128 | Draws UCC 128 type barcode |
prnDrawUPCA | Draws UPC-A type barcode |
prnDrawUPCE | Draws UPC-E type barcode |
prnDrawPDF417 | Draws PDF417 type barcode |
prnSetBarCodeHeight | Sets height of the bar code |
prnSetBarCodeScale | Sets scale factor of the bar code |
prnSetBarCodeAngle | Sets 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
Method | Description |
ASCII_Init | Initialization of library |
ASCII_UnInit | Deinitialization of library |
ASCII_SetComPortParam | Set COM port parameters |
ASCII_SetLanguage | This function sets language of the user interface |
ASCII_SetupPort | This function displays Port Setup dialog box |
Print Info
Method | Description |
ASCII_GetVersion | Returns current version of library |
ASCII_GetState | This function allows to get the current statement of a printing driver. |
ASCII_GetSentBytes | This function allows to get a number of bytes sent to printer. |
Connect/Disconnect
Method | Description |
ASCII_Connect | Connect to printer |
ASCII_ConnectSilent | Connect to printer (prohibits presentation of a current printing statement window) |
ASCII_Disconnect | Close connection |
Send data
Method | Description |
ASCII_SendString | This function allows to send string to printer |
ASCII_SendChar | This function allows to send single character (byte) to printer |
ASCII_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 PropertiesDescription Init MethodInitialization of library UnInit MethodDeinitialization of library. SetupDlg MethodDisplays Print Setup dialog box. StartDoc MethodStarts a print job. EndDoc MethodEnds a print job StartPage MethodPrepares the printer driver to accept data SilentSetup MethodSet up printing without a printing dialog. Silent PropertyControls (permits or prohibits) presentation of a current printing statement window. PDFFile PropertySets output PDF file path. Language PropertySets language of the user interface. Print info
Method Methods or PropertiesDescription Version PropertyCurrent version of PrintCE driver GetCurrentSetup MethodAllows to get the current settings of printing. State PropertyCurrent statement of a printing driver. Connection PropertyCurrent statement of a connection. SentBytes PropertyNumber of bytes sent to printer. Text Functions
Method Methods or PropertiesDescription DrawText MethodDraws a text DrawText2 MethodDraws a text with the selected colour DrawTextFlow MethodFlows text on the page GetTextFlowHeight MethodReturns height of text DrawAlignedText MethodDraws a text horizontally and vertically aligned Ellipse Functions
Method Methods or PropertiesDescription DrawEllipse MethodDraws an ellipse DrawCircle MethodDraws a circle of the selected radius Line-Polygon Functions
Method Methods or PropertiesDescription DrawLine MethodDraws a line DrawRect MethodDraws a rectangle DrawSolidRect MethodDraws a rectangle filled with the selected colour DrawRoundRect MethodDraws a rectangle with rounded corners Bitmap Functions
Method Methods or PropertiesDescription DrawPicture MethodDraws JPG or BMP file GetPictureSize MethodReturns size of the picture in the JPG orBMP file Convert Function
Method Methods or PropertiesDescription ConvertValue MethodTransfers values from one measurement unit to another Drawing-Attribute
Method Methods or PropertiesDescription MeasureUnit PropertyCurrent measurement unit for coordinates LineWidth PropertyWidth of the line used for printing of rectangles, ellipses, lines and so on LineColor PropertyColour of the line used for printing of rectangles, ellipses, lines and so on FillColor PropertyColour of the filling used for printing of rectangles, ellipses, lines and so on FillStyle PropertyPattern of the filling used for printing of rectangles, ellipses and so on TextColor PropertyColour of the text used by functions DrawText(), DrawAlignedText() for printing TransparentTextBgr PropertyBackground mode of the text used by functions DrawText(), DrawAlignedText() and DrawText2() TextHorAlign PropertyValue that determines the horizontal justification used by functions DrawText() and DrawText2() TextVertAlign PropertyValue that determines the vertical justification used by functions DrawText() and DrawText2() Font Functions
Method Methods or PropertiesDescription FontName PropertyName of the font used by functions DrawText(), DrawText2, DrawAlignedText() for printing FontSize PropertySize of the font (in points) used by functions DrawText(), DrawText2, DrawAlignedText() for printing SetFontSize2 MethodSets size of the font used by the functions DrawText(), DrawText2, DrawAlignedText() for printing in the selected units GetFontSize2 MethodReturns font size in the selected measurement units FontBold PropertyReturns and sets the Bold font style FontItalic PropertyReturns and sets the Italic font style FontStrike PropertyReturns and sets the Strikeout font style FontUnderline PropertyReturns and sets the Underline font style GetTextHeight MethodReturns height of the text in the current units GetTextWidth MethodReturns width of the text in the current units Page Atribute
Method Methods or PropertiesDescription PageHeight PropertyReturns height of the page in the current units PageWidth PropertyReturns width of the page in the current units LeftMargin PropertyLeft margin on the page in the current measurement units RightMargin PropertyRight margin on the page in the current measurement units TopMargin PropertyTop margin on the page in the current measurement units BottomMargin PropertyBottom margin on the page in the current measurement units Barcode Methods
Method Methods or PropertiesDescription Draw2OF5 MethodDraws Interleaved 2 of 5 type barcode. DrawCodaBar MethodDraws Codabar type barcode. DrawCode39 MethodDraws Code 39 type barcode. DrawCode93 MethodDraws Code 93 type barcode. DrawCode128 MethodDraws Code 128 type barcode. DrawEAN8 MethodDraws EAN-8 type barcode DrawEAN13 MethodDraws EAN-13 type barcode DrawMSI MethodDraws MSI type barcode DrawPostnet MethodDraws Postnet type barcode DrawUCC128 MethodDraws UCC 128 type barcode DrawUPCA MethodDraws UPC-A type barcode DrawUPCE MethodDraws UPC-E type barcode BarcodeHeight PropertyHeight of the bar code
Printing using PrintAscii ActiveX control
Instruction for Visual Basic (eVB 3.0) | Description functionsTo 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 PropertiesDescription Init MethodInitialization of library UnInit MethodDeinitialization of library. SetComPortParam MethodSet COM port parameters. Print Info
Method Methods or PropertiesDescription Version PropertyCurrent version of library State PropertyCurrent statement of a printing driver. SentBytes PropertyNumber of bytes sent to printer. Connect/Disconnect
Method Methods or PropertiesDescription Connect MethodConnect to printer Disconnect MethodClose connection Send data
Method Methods or PropertiesDescription SendString MethodSend string to printer SendChar MethodSend 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 PropertiesDescription Init MethodInitialization of library UnInit MethodDeinitialization of library. SetupDlg MethodDisplays Print Setup dialog box. StartDoc MethodStarts a print job. EndDoc MethodEnds a print job StartPage MethodPrepares the printer driver to accept data SilentPrintSetup MethodSet up printing without a printing dialog. SilentMode PropertyControls (permits or prohibits) presentation of a current printing statement window. PDFFile PropertySets output PDF file path. Language PropertySets language of the user interface. SetPrnParam MethodSets specific printer and port settings. Print info
Method Methods or PropertiesDescription Version PropertyCurrent version of PrintCE driver GetCurrentSetup MethodAllows to get the current settings of printing. State PropertyCurrent statement of a printing driver. Connection PropertyCurrent statement of a connection. SentBytes PropertyNumber of bytes sent to printer. Text Functions
Method Methods or PropertiesDescription DrawText MethodDraws a text DrawText2 MethodDraws a text with the selected colour DrawTextFlow MethodFlows text on the page GetTextFlowHeight MethodReturns height of text DrawAlignedText MethodDraws a text horizontally and vertically aligned Ellipse Functions
Method Methods or PropertiesDescription DrawEllipse MethodDraws an ellipse DrawCircle MethodDraws a circle of the selected radius Line-Polygon Functions
Method Methods or PropertiesDescription DrawLine MethodDraws a line DrawRect MethodDraws a rectangle DrawSolidRect MethodDraws a rectangle filled with the selected colour DrawRoundRect MethodDraws a rectangle with rounded corners Bitmap Functions
Method Methods or PropertiesDescription DrawPicture MethodDraws JPG or BMP file DrawBitmap MethodDraws Bitmap GetPictureSize MethodReturns size of the picture in the JPG orBMP file Convert Function
Method Methods or PropertiesDescription ConvertValue MethodTransfers values from one measurement unit to another Drawing-Attribute
Method Methods or PropertiesDescription MeasureUnit PropertyCurrent measurement unit for coordinates LineWidth PropertyWidth of the line used for printing of rectangles, ellipses, lines and so on LineColor PropertyColour of the line used for printing of rectangles, ellipses, lines and so on FillColor PropertyColour of the filling used for printing of rectangles, ellipses, lines and so on FillStyle PropertyPattern of the filling used for printing of rectangles, ellipses and so on TextColor PropertyColour of the text used by functions DrawText(), DrawAlignedText() for printing TransparentTextBgr PropertyBackground mode of the text used by functions DrawText(), DrawAlignedText() and DrawText2() TextHorAlign PropertyValue that determines the horizontal justification used by functions DrawText() and DrawText2() TextVertAlign PropertyValue that determines the vertical justification used by functions DrawText() and DrawText2() Font Functions
Method Methods or PropertiesDescription FontName PropertyName of the font used by functions DrawText(), DrawText2, DrawAlignedText() for printing FontSize PropertySize of the font (in points) used by functions DrawText(), DrawText2, DrawAlignedText() for printing FontBold PropertyReturns and sets the Bold font style FontItalic PropertyReturns and sets the Italic font style FontStrike PropertyReturns and sets the Strikeout font style FontUnderline PropertyReturns and sets the Underline font style FontAngle PropertyReturns and sets the rotation angle of the font GetTextHeight MethodReturns height of the text in the current units GetTextWidth MethodReturns width of the text in the current units Page Atribute
Method Methods or PropertiesDescription PageHeight PropertyReturns height of the page in the current units PageWidth PropertyReturns width of the page in the current units LeftMargin PropertyLeft margin on the page in the current measurement units RightMargin PropertyRight margin on the page in the current measurement units TopMargin PropertyTop margin on the page in the current measurement units BottomMargin PropertyBottom margin on the page in the current measurement units Barcode Methods
Method Methods or PropertiesDescription Draw2OF5 MethodDraws Interleaved 2 of 5 type barcode. DrawCodaBar MethodDraws Codabar type barcode. DrawCode39 MethodDraws Code 39 type barcode. DrawCode93 MethodDraws Code 93 type barcode. DrawCode128 MethodDraws Code 128 type barcode. DrawEAN8 MethodDraws EAN-8 type barcode DrawEAN13 MethodDraws EAN-13 type barcode DrawMSI MethodDraws MSI type barcode DrawPostnet MethodDraws Postnet type barcode DrawUCC128 MethodDraws UCC 128 type barcode DrawUPCA MethodDraws UPC-A type barcode DrawUPCE MethodDraws UPC-E type barcode DrawPDF417 MethodDraws PDF417 type barcode BarcodeHeight PropertyHeight of the bar code BarcodeScale PropertyScale factor of the bar code BarcodeAngle PropertyRotation angle of the bar code
Description of methods and properties of PrintAscii .NET control :
Initialization
Method Methods or PropertiesDescription Init MethodInitialization of library UnInit MethodDeinitialization of library. SetComPortParam MethodSet COM port parameters. Language PropertyLanguage of the user interface. SetupPort MethodDisplays Port Setup dialog box. Print Info
Method Methods or PropertiesDescription Version PropertyCurrent version of library State PropertyCurrent statement of a printing driver. SentBytes PropertyNumber of bytes sent to printer. Connect/Disconnect
Method Methods or PropertiesDescription Connect MethodConnect to printer ConnectSilent MethodConnect to printer (prohibits presentation of a current printing statement window) Disconnect MethodClose connection Send data
Method Methods or PropertiesDescription SendString MethodSend string to printer SendByte MethodSend single byte (character) to printer SendBytes MethodSend array of bytes to printer