Wilson,
Muchas gracias

Si no tienes inconveniente vamos a copiar aqui el código para que le sea de utilidad a otros usuarios

pidion.prg
Code: Select all | Expand
#define __TEST__
//definiciones para la pidion
#define BB_PRINTER_SEORO 0
#define BB_PRINTER_SEIKO 1
#define BB_PRINTER_NONE 2
#define BB_PRINT_DEFAULT 0
#define BB_PRINT_EMPHASIZE 1
#define BB_PRINT_CENTERALIGN 2
#define BB_PRINT_RIGHTALIGN 4
#define BB_PRINT_DOUBLEWIDTH 8
#define BB_PRINT_DOUBLEHEIGHT 16
#define BB_PRINT_DOUBLESIZE 24
#define BB_PRINT_UNDERLINE 32
#define BB_PRINT_DENSITY_60PERCENT 0
#define BB_PRINT_DENSITY_70PERCENT 1
#define BB_PRINT_DENSITY_80PERCENT 2
#define BB_PRINT_DENSITY_90PERCENT 3
#define BB_PRINT_DENSITY_100PERCENT 4
#define BB_PRINT_DENSITY_110PERCENT 5
#define BB_PRINT_DENSITY_120PERCENT 6
#define BB_PRINT_DENSITY_130PERCENT 7
#define BB_PRINT_DENSITY_140PERCENT 8
#define BB_PRINT_DENSITY_DEFAULT BB_PRINT_DENSITY_90PERCENT
#define BB_PRINT_DENSITY_MIN BB_PRINT_DENSITY_60PERCENT
#define BB_PRINT_DENSITY_MAX BB_PRINT_DENSITY_140PERCENT
#define BB_PRINT_LINESPACING_ONESIXTH 24
#define BB_PRINT_LINESPACING_DEFAULT 24
#define BB_PRINT_LINESPACING_MAX 255
#define BB_PRINT_BARCODE_UPCA 65
#define BB_PRINT_BARCODE_JAN13 67
#define BB_PRINT_BARCODE_JAN8 68
#define BB_PRINT_BARCODE_CODE39 69
#define BB_PRINT_BARCODE_ITF 70
#define BB_PRINT_BARCODE_CODABAR 71
#define BB_PRINT_BARCODE_CODE93 72
#define BB_PRINT_BARCODE_CODE128 73
#define BB_PRINT_BARCODE_CODE128A 73
#define BB_PRINT_BARCODE_CODE128B 74
#define BB_PRINT_BARCODE_CODE128C 75
#define BB_PRINT_BARCODE_WIDTH_THIN 2
#define BB_PRINT_BARCODE_WIDTH_NORMAL 3
#define BB_PRINT_BARCODE_WIDTH_THICK 4
#define BB_PRINT_BARCODE_WIDTH_MORETHICK 5
#define BB_PRINT_BARCODE_WIDTH_MOSTTHICK 6
#define BB_PRINT_BARCODE_ALIGN_LEFT 0
#define BB_PRINT_BARCODE_ALIGN_CENTER 2
#define BB_PRINT_BARCODE_ALIGN_RIGHT 4
#define BB_PRINT_BITMAP_NORMAL 0
#define BB_PRINT_BITMAP_DOUBLE_HEIGHT 1
#define BB_PRINT_BITMAP_DOUBLE_WIDTH 2
#define BB_PRINT_BITMAP_DOUBLE 3
#define BB_PRINT_BITMAP_ALIGN_CENTER 4
#define BB_PRINT_BITMAP_ALIGN_RIGHT 8
#define BB_PRINT_FONTTYPE_42 0
#define BB_PRINT_FONTTYPE_40 1
#define BB_PRINT_FONTTYPE_32 2
#define BB_PRINT_FONTSET_ASCII 0
#define BB_PRINT_FONTSET_HANGUL 1
#define BB_PRINT_FONTSET_SYMBOL 2
#define BB_PRINT_FONTSET_THAI 3
#include "FWCE.ch"
#include "vKey.ch"
#include "winapi.ch"
#include "DbInfo.ch"
#define SISTEMA "Jose-Pocket-Pc"
#define RDD_SISTEMA 'DbfCdx'
#ifdef __TEST__
Function Main
ProvaStampaPidion()
Return Nil
#endif
FUNCTION ProvaStampaPidion()
LOCAL i
//Prt_ProvaStampa()
Prt_Open()
Prt_Init()
Prt_PrintText( AnsiToWide( "Prova Riga 1" + CRLF ), BB_PRINT_DEFAULT )
Prt_PrintText( AnsiToWide( "Prova Riga 2" + CRLF ), BB_PRINT_CENTERALIGN )
Prt_PrintText( AnsiToWide( "Prova Riga 3" + CRLF ), BB_PRINT_RIGHTALIGN )
Prt_PrintText( AnsiToWide( "Prova Riga 4" + CRLF ), BB_PRINT_DOUBLEWIDTH )
Prt_PrintText( AnsiToWide( "Prova Riga 5" + CRLF ), BB_PRINT_DOUBLEHEIGHT )
Prt_PrintText( AnsiToWide( "Prova Riga 6" + CRLF ), BB_PRINT_DOUBLESIZE )
Prt_PrintText( AnsiToWide( "Prova Riga 7" + CRLF ), BB_PRINT_UNDERLINE )
Prt_PrintText( AnsiToWide( "Prova Riga 8" + CRLF ), BB_PRINT_CENTERALIGN + BB_PRINT_UNDERLINE )
/*
#define BB_PRINT_EMPHASIZE 1
#define BB_PRINT_CENTERALIGN 2
#define BB_PRINT_RIGHTALIGN 4
#define BB_PRINT_DOUBLEWIDTH 8
#define BB_PRINT_DOUBLEHEIGHT 16
#define BB_PRINT_DOUBLESIZE 24
#define BB_PRINT_UNDERLINE 32
*/
FOR i := 1 TO 4
Prt_PrintText( AnsiToWide( CRLF ), BB_PRINT_DEFAULT )
NEXT
//Sleep(100)
Prt_Close()
msginfo("Chiusa")
RETURN NIL
********
FUNCTION Prt_LineFeedByLine( nRighe )
********
LOCAL i
DEFAULT nRighe := 1
FOR i := 1 TO nRighe
Prt_PrintText( AnsiToWide( CRLF ), BB_PRINT_DEFAULT )
NEXT
RETURN NIL
/// programas para comunicarsze con la impresora de pidion
#pragma BEGINDUMP
#include "hbapi.h"
#include "windows.h"
#include "bbappapi.h"
#include "bberror.h"
static HBBPRINTER hPrinter;
HB_FUNC( PRT_OPEN )
{
hPrinter = BBPrinterOpen( 0 );
if ( !hPrinter )
{
return;
}
}
HB_FUNC( PRT_CLOSE )
{
DWORD dwRet = BBPrinterWaitUntilPrintEnd( hPrinter );
BBPrinterClose( hPrinter );
}
HB_FUNC( PRT_INIT )
{
BBPrinterSetLineSpacing( hPrinter, 8 ); // Set line spacing 1/18 inch.
BBPrinterSetDensity( hPrinter, BB_PRINT_DENSITY_100PERCENT ); // Set density 100%
BBPrinterInit( hPrinter );
}
HB_FUNC( PRT_PRINTBITMAP )
{
BBPrinterPrintBitmap( hPrinter, (LPCTSTR) hb_parc(1), BB_PRINT_BITMAP_NORMAL );
}
HB_FUNC( PRT_PRINTTEXT )
{
BBPrinterPrint( hPrinter, (LPCTSTR)hb_parc(1), (DWORD)hb_parnl(2) );
}
HB_FUNC( PRT_PROVASTAMPA )
{
HBBPRINTER hPrinter = BBPrinterOpen( 0 );
if ( !hPrinter )
{
return;
}
BBPrinterSetLineSpacing( hPrinter, 8 ); // Set line spacing 1/18 inch.
BBPrinterSetDensity( hPrinter, BB_PRINT_DENSITY_100PERCENT ); // Set density 100%
BBPrinterInit( hPrinter );
BBPrinterPrint( hPrinter, _T("LineSpacing 1/6, Density 60% \n"), BB_PRINT_DEFAULT );
BBPrinterPrint( hPrinter, _T("LineSpacing 1/6, Density 60% \n"), BB_PRINT_DEFAULT );
BBPrinterPrint( hPrinter, _T("LineSpacing 1/6, Density 60% \n"), BB_PRINT_DEFAULT );
BBPrinterPrint( hPrinter, _T("LineSpacing 1/6, Density 60% \n"), BB_PRINT_DEFAULT );
BBPrinterPrint( hPrinter, _T("LineSpacing 1/6, Density 60% \n"), BB_PRINT_DEFAULT );
DWORD dwRet = BBPrinterWaitUntilPrintEnd( hPrinter );
BBPrinterClose( hPrinter );
}
//LPCTSTR
//BBPrinterPrint( hPrinter, _T("LineSpacing 1/6, Density 60% \n"), BB_PRINT_DEFAULT );
//BBPrinterInit( hPrinter );
//BBPrinterWaitUntilPrintEnd( hPrinter );
//BBPrinterClose( hPrinter );
#pragma ENDDUMP
Aqui está el fichero completo de Wilson con las librerías necesarias para la pidion:
http://www.fivetechsoft.com/files/utilities/pidion.zip