User Manual PrintDLL SDK

More Information:

DC mode

1. Load printing library LoadPrintLib().

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

2. Print Setup DC_PrinterSet

// start print setup
DC_PrinterSet (printerInfo);

3. Start printing document DC_StartDoc

// start printing document
DC_StartDoc();

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

4.1 Start printing page DC_StartPage

// start printing page
DC_StartPage();

4.2 Print elements using set of font function DC_SetFont

// print heading with font of 36 points in height 15 points in width, italic,underLine

FontProperty fp;

pf.bDefault = false;
pf.bItalic = true;
pf.bStrikeout = false;
pf.bUnderLine = true;
pf.iCharSet = 0;
pf.nWidth = 15;
pf.nHeight = 36;
pf.iWeight = 500;
DC_SetFont(fontProperty);
DC_PrintText(_T("Hello World"), 0, 0);

5. End printing document DC_EndDoc

// end printing document
DC_EndDoc();

6. Unload printing library UnloadPrintLib()

UnloadPrintLib();

ASCII mode

1. Load printing library LoadPrintLib().

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

2. Open printer as ascii mode ASCII_OpenPrinter

//Open virsual or real COM port
ASCII_OpenPrinter(3);

3. Configure port if need ASCII_SetComPortParam

ComState cs;
cs.dwBaudRate = 19200;
cs.Parity = NOPARITY;
cs.StopBits = ONESTOPBIT;

ASCII_SetComPortParam(cs);

4. Send string or hex using ASCII_DirectData

TCHAR szBuff[] = {0x1b,0x57,0x02};
ASCII_DirectData(szBuff), 3);
ASCII_DirectData(_T("Hello World"), 10);
szBuff[2] = 0x01;
ASCII_DirectData(szBuff), 3);
ASCII_DirectData(_T("Hello World"), 10);

5. Close COM port ASCII_ClosePrinter

ASCII_ClosePrinter();

6. Unload printing library UnloadPrintLib()

UnloadPrintLib();

 
Print flow control    
Func Detail
DC_PrinterSet

This function set the base property of print job

DC_StartDoc This function starts a print job and initialize graphic engine
DC_StartPage Init page or print page
DC_EndDoc This function ends a print job and print the last page
Printer property    
Func Detail
DC_GetConnectedStatus Get print connect status
DC_GetDevCaps This function retrieves information about the capabilities of a specified device
DC_GetMapMode The function return the current map mode unit for coordinates
DC_SetMapMode The function sets the current map mode unit for coordinates
Text funcion    
Func Detail
DC_SetFont This function set font property
DC_PrintText This function draws formatted text
DC_PrintTextBlock This function draws formatted text in the specified rectangle
Drawing function    
Func Detail
DC_SetBorderMode Set border whether take effect in border
DC_SetFillMode Set border whether take effect in fill backgrond
DC_GetLineWidth Get draw line width
DC_SetLineWidth Set draw line width
DC_DrawEllips This function draws an ellipse
DC_DrawLine This function draws a line
DC_DrawRect This function draws a rectangle
DC_DrawRoundRect This function draws a rectangle with round corners
DC_DrawCircle This function draws a circle
Bitmap function    
Func Detail
DC_ConvertMonoPicture The function converts color BMP file to monochrome BMP file
DC_GetPictureSize The function returns size of the picture in the monochrome BMP file
DC_PrintPicture This function print a picture in the monochrome BMP file
Barcode function    
Func Detail
DC_SetBarcodeHeight This function set the barcode height
DC_Draw2of5 Draws Interleaved 2 of 5 type barcode
DC_DrawCodaBar Draws Codabar type barcode
DC_DrawCode128 Draws Code 128 type barcode
DC_DrawCode39 Draws Code 39 type barcode
DC_DrawCode93 Draws Code 93 type barcode
DC_DrawUPCA Draws UPC-A type barcode
DC_DrawUPCE Draws UPC-E type barcode
DC_DrawEAN13 Draws Code EAN13 type barcode
DC_DrawEAN8 Draws Code EAN8 type barcode
ASCII printing    
Func Detail
ASCII_OpenPrinter Open the virtual or actual COM port
ASCII_ClosePrinter Close the virtual or actual COM port
ASCII_SendString Send string to printer
ASCII_DirectData Send data to printer
ASCII_SelectPrinter Select printer type
ASCII_SetComPortParam Configure COM port
ASCII_GetPrinterStatus Get printer status
     
2012 SPRT . All rights reserved.