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 pageDevice 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 contextType-Safe Selection Methods
MethodDescriptionPDC_SelectObjectThis function selects an object (HFONT, HBRUSH, HPEN, HBITMAP, or HDIBSECTION) into a printer device contextDrawing-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 ellipseBitmap 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 codePrinting 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 alignedEllipse Functions
MethodDescriptionprnDrawEllipseThis function draws an ellipseprnDrawCircleThe function draws a circle of the selected radiusLine-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 cornersBitmap Functions
MethodDescriptionprnDrawPictureThe function draws JPG or BMP fileprnGetPictureSizeThe function returns size of the picture in the JPG or BMP fileprnDrawBitmapThe function draws HBITMAPConvert 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 degreePage 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 unitsBarcode 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 boxPrint 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 connectionSend 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
MethodMethods or PropertiesDescriptionInitMethodInitialization of libraryUnInitMethodDeinitialization of library.SetupDlgMethodDisplays Print Setup dialog box.StartDocMethodStarts a print job.EndDocMethodEnds a print jobStartPageMethodPrepares the printer driver to accept dataSilentSetupMethodSet up printing without a printing dialog.SilentPropertyControls (permits or prohibits) presentation of a current printing statement window.PDFFilePropertySets output PDF file path.LanguagePropertySets language of the user interface.Print info
MethodMethods or PropertiesDescriptionVersionPropertyCurrent version of PrintCE driverGetCurrentSetupMethodAllows to get the current settings of printing.StatePropertyCurrent statement of a printing driver.ConnectionPropertyCurrent statement of a connection.SentBytesPropertyNumber of bytes sent to printer.Text Functions
MethodMethods or PropertiesDescriptionDrawTextMethodDraws a textDrawText2MethodDraws a text with the selected colourDrawTextFlowMethodFlows text on the pageGetTextFlowHeightMethodReturns height of textDrawAlignedTextMethodDraws a text horizontally and vertically alignedEllipse Functions
MethodMethods or PropertiesDescriptionDrawEllipseMethodDraws an ellipseDrawCircleMethodDraws a circle of the selected radiusLine-Polygon Functions
MethodMethods or PropertiesDescriptionDrawLineMethodDraws a lineDrawRectMethodDraws a rectangleDrawSolidRectMethodDraws a rectangle filled with the selected colourDrawRoundRectMethodDraws a rectangle with rounded cornersBitmap Functions
MethodMethods or PropertiesDescriptionDrawPictureMethodDraws JPG or BMP fileGetPictureSizeMethodReturns size of the picture in the JPG orBMP fileConvert Function
MethodMethods or PropertiesDescriptionConvertValueMethodTransfers values from one measurement unit to anotherDrawing-Attribute
MethodMethods or PropertiesDescriptionMeasureUnitPropertyCurrent measurement unit for coordinatesLineWidthPropertyWidth of the line used for printing of rectangles, ellipses, lines and so onLineColorPropertyColour of the line used for printing of rectangles, ellipses, lines and so onFillColorPropertyColour of the filling used for printing of rectangles, ellipses, lines and so onFillStylePropertyPattern of the filling used for printing of rectangles, ellipses and so onTextColorPropertyColour of the text used by functions DrawText(), DrawAlignedText() for printingTransparentTextBgrPropertyBackground mode of the text used by functions DrawText(), DrawAlignedText() and DrawText2()TextHorAlignPropertyValue that determines the horizontal justification used by functions DrawText() and DrawText2()TextVertAlignPropertyValue that determines the vertical justification used by functions DrawText() and DrawText2()Font Functions
MethodMethods or PropertiesDescriptionFontNamePropertyName of the font used by functions DrawText(), DrawText2, DrawAlignedText() for printingFontSizePropertySize of the font (in points) used by functions DrawText(), DrawText2, DrawAlignedText() for printingSetFontSize2MethodSets size of the font used by the functions DrawText(), DrawText2, DrawAlignedText() for printing in the selected unitsGetFontSize2MethodReturns font size in the selected measurement unitsFontBoldPropertyReturns and sets the Bold font styleFontItalicPropertyReturns and sets the Italic font styleFontStrikePropertyReturns and sets the Strikeout font styleFontUnderlinePropertyReturns and sets the Underline font styleGetTextHeightMethodReturns height of the text in the current unitsGetTextWidthMethodReturns width of the text in the current unitsPage Atribute
MethodMethods or PropertiesDescriptionPageHeightPropertyReturns height of the page in the current unitsPageWidthPropertyReturns width of the page in the current unitsLeftMarginPropertyLeft margin on the page in the current measurement unitsRightMarginPropertyRight margin on the page in the current measurement unitsTopMarginPropertyTop margin on the page in the current measurement unitsBottomMarginPropertyBottom margin on the page in the current measurement unitsBarcode Methods
MethodMethods or PropertiesDescriptionDraw2OF5MethodDraws Interleaved 2 of 5 type barcode.DrawCodaBarMethodDraws Codabar type barcode.DrawCode39MethodDraws Code 39 type barcode.DrawCode93MethodDraws Code 93 type barcode. DrawCode128MethodDraws Code 128 type barcode.DrawEAN8MethodDraws EAN-8 type barcodeDrawEAN13MethodDraws EAN-13 type barcodeDrawMSIMethodDraws MSI type barcodeDrawPostnetMethodDraws Postnet type barcodeDrawUCC128MethodDraws UCC 128 type barcodeDrawUPCAMethodDraws UPC-A type barcodeDrawUPCEMethodDraws UPC-E type barcodeBarcodeHeightPropertyHeight 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
MethodMethods or PropertiesDescriptionInitMethodInitialization of libraryUnInitMethodDeinitialization of library.SetComPortParamMethodSet COM port parameters.Print Info
MethodMethods or PropertiesDescriptionVersionPropertyCurrent version of libraryStatePropertyCurrent statement of a printing driver.SentBytesPropertyNumber of bytes sent to printer.Connect/Disconnect
MethodMethods or PropertiesDescriptionConnectMethodConnect to printerDisconnectMethodClose connectionSend data
MethodMethods or PropertiesDescriptionSendStringMethodSend string to printerSendCharMethodSend 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
MethodMethods or PropertiesDescriptionInitMethodInitialization of libraryUnInitMethodDeinitialization of library.SetupDlgMethodDisplays Print Setup dialog box.StartDocMethodStarts a print job.EndDocMethodEnds a print jobStartPageMethodPrepares the printer driver to accept dataSilentPrintSetupMethodSet up printing without a printing dialog.SilentModePropertyControls (permits or prohibits) presentation of a current printing statement window.PDFFilePropertySets output PDF file path.LanguagePropertySets language of the user interface.SetPrnParamMethodSets specific printer and port settings.Print info
MethodMethods or PropertiesDescriptionVersionPropertyCurrent version of PrintCE driverGetCurrentSetupMethodAllows to get the current settings of printing.StatePropertyCurrent statement of a printing driver.ConnectionPropertyCurrent statement of a connection.SentBytesPropertyNumber of bytes sent to printer.Text Functions
MethodMethods or PropertiesDescriptionDrawTextMethodDraws a textDrawText2MethodDraws a text with the selected colourDrawTextFlowMethodFlows text on the pageGetTextFlowHeightMethodReturns height of textDrawAlignedTextMethodDraws a text horizontally and vertically alignedEllipse Functions
MethodMethods or PropertiesDescriptionDrawEllipseMethodDraws an ellipseDrawCircleMethodDraws a circle of the selected radiusLine-Polygon Functions
MethodMethods or PropertiesDescriptionDrawLineMethodDraws a lineDrawRectMethodDraws a rectangleDrawSolidRectMethodDraws a rectangle filled with the selected colourDrawRoundRectMethodDraws a rectangle with rounded cornersBitmap Functions
MethodMethods or PropertiesDescriptionDrawPictureMethodDraws JPG or BMP fileDrawBitmapMethodDraws BitmapGetPictureSizeMethodReturns size of the picture in the JPG orBMP fileConvert Function
MethodMethods or PropertiesDescriptionConvertValueMethodTransfers values from one measurement unit to anotherDrawing-Attribute
MethodMethods or PropertiesDescriptionMeasureUnitPropertyCurrent measurement unit for coordinatesLineWidthPropertyWidth of the line used for printing of rectangles, ellipses, lines and so onLineColorPropertyColour of the line used for printing of rectangles, ellipses, lines and so onFillColorPropertyColour of the filling used for printing of rectangles, ellipses, lines and so onFillStylePropertyPattern of the filling used for printing of rectangles, ellipses and so onTextColorPropertyColour of the text used by functions DrawText(), DrawAlignedText() for printingTransparentTextBgrPropertyBackground mode of the text used by functions DrawText(), DrawAlignedText() and DrawText2()TextHorAlignPropertyValue that determines the horizontal justification used by functions DrawText() and DrawText2()TextVertAlignPropertyValue that determines the vertical justification used by functions DrawText() and DrawText2()Font Functions
MethodMethods or PropertiesDescriptionFontNamePropertyName of the font used by functions DrawText(), DrawText2, DrawAlignedText() for printingFontSizePropertySize of the font (in points) used by functions DrawText(), DrawText2, DrawAlignedText() for printingFontBoldPropertyReturns and sets the Bold font styleFontItalicPropertyReturns and sets the Italic font styleFontStrikePropertyReturns and sets the Strikeout font styleFontUnderlinePropertyReturns and sets the Underline font styleFontAnglePropertyReturns and sets the rotation angle of the fontGetTextHeightMethodReturns height of the text in the current unitsGetTextWidthMethodReturns width of the text in the current unitsPage Atribute
MethodMethods or PropertiesDescriptionPageHeightPropertyReturns height of the page in the current unitsPageWidthPropertyReturns width of the page in the current unitsLeftMarginPropertyLeft margin on the page in the current measurement unitsRightMarginPropertyRight margin on the page in the current measurement unitsTopMarginPropertyTop margin on the page in the current measurement unitsBottomMarginPropertyBottom margin on the page in the current measurement unitsBarcode Methods
MethodMethods or PropertiesDescriptionDraw2OF5MethodDraws Interleaved 2 of 5 type barcode.DrawCodaBarMethodDraws Codabar type barcode.DrawCode39MethodDraws Code 39 type barcode.DrawCode93MethodDraws Code 93 type barcode. DrawCode128MethodDraws Code 128 type barcode.DrawEAN8MethodDraws EAN-8 type barcodeDrawEAN13MethodDraws EAN-13 type barcodeDrawMSIMethodDraws MSI type barcodeDrawPostnetMethodDraws Postnet type barcodeDrawUCC128MethodDraws UCC 128 type barcodeDrawUPCAMethodDraws UPC-A type barcodeDrawUPCEMethodDraws UPC-E type barcodeDrawPDF417MethodDraws PDF417 type barcodeBarcodeHeightPropertyHeight of the bar codeBarcodeScalePropertyScale factor of the bar codeBarcodeAnglePropertyRotation angle of the bar code
Description of methods and properties of PrintAscii .NET control :
Initialization
MethodMethods or PropertiesDescriptionInitMethodInitialization of libraryUnInitMethodDeinitialization of library.SetComPortParamMethodSet COM port parameters.LanguagePropertyLanguage of the user interface.SetupPortMethodDisplays Port Setup dialog box.Print Info
MethodMethods or PropertiesDescriptionVersionPropertyCurrent version of libraryStatePropertyCurrent statement of a printing driver.SentBytesPropertyNumber of bytes sent to printer.Connect/Disconnect
MethodMethods or PropertiesDescriptionConnectMethodConnect to printerConnectSilentMethodConnect to printer (prohibits presentation of a current printing statement window)DisconnectMethodClose connectionSend data
MethodMethods or PropertiesDescriptionSendStringMethodSend string to printerSendByteMethodSend single byte (character) to printerSendBytesMethodSend array of bytes to printer
- c# PrintCE SDK dll 开发文档 无线 蓝牙 打印 A4纸 组件 原创
- PrinterCE.NetCF SDK 开发 蓝牙打印组件 原创
- A4纸网页打印
- smartforms打印非A4纸
- 一张A4纸打印报表
- 打印PPT铺满A4纸
- .Net中的打印A4纸如何实现(以C#为例)
- 将两页A4 pdf文档合并到一页A4页面上打印的方法
- A4文档打印为A3双面的解决办法
- c# 蓝牙打印
- C# Moblie 蓝牙打印
- excel 打印 调整为A4纸大小
- A4纸像素及WEB打印样式
- Office 如何打印A4不干胶标签纸
- J2me蓝牙打印开发
- J2me蓝牙打印开发
- 蓝牙&WiFi 智能手机无线打印全攻略
- Android无线蓝牙开发总结
- .net关闭进程的代码
- ubuntu上实践Omega
- 琉璃墨,谨颜
- 2011-07-05|永安考场|科目三顺利通过
- 超声波换能器产品选用说明
- c# PrintCE SDK dll 开发文档 无线 蓝牙 打印 A4纸 组件 原创
- [转]磁盘为什么只能分四个主分区
- 把自己的程序切入后台
- db2报SQLCODE: -443, SQLSTATE: 38553错误的解决办法
- 堆和栈的区别(转过无数次的文章)
- 非域环境下安装并配置Project Server 2007
- Windows Azure的数据存储和性能比较(一)
- extjs 之Ext.data.Store[Grid]操作(增删)
- Discuz X 发帖提交器一点实现