Tratando de generar archivos PDF, hago esto:
- Code: Select all Expand view RUN
REQUEST FWHARU ////////////////////////////////////////////////////////////////////////////
static Principal,PantReci
memvar _arc
field num_rec,imp_rec,ben_rec,con_re1,con_re2,sit_rec,fec_rec
function Main(cOtros)
Imprimir(nOpc)
return NIL
function Imprimir(nOpc)
local nIni,nFin,bPant,n,nR,nC,nReg:=RecNo(),nOrdAnt:=OrdSetFocus(),nAncho,oPrn,oFont,nSup
if nOpc==1
if sit_rec=='C'
return aviso('El recibo fue cancelado')
endif
nIni:=Val(num_rec)
nFin:=Val(num_rec)
else
nIni:=Val(num_rec)
DBGoBottom()
nFin:=Val(num_rec)
bPant:=AbreVent(0,0,4,52,'Impresión de recibos')
@ 1, 2 say 'Recibo inicial' get nIni picture '99999999'
@ 1,28 say 'Recibo final' get nFin picture '99999999';
valid {||nFin>=nIni}
if !aDialogo(NIL,.t.)
DBGoTo(nReg)
return NIL
endif
endif
OrdSetFocus(1)
TPrinter():lUseHaruPdf:=.t. //////////////////////////////////////////////////////////////////////////////
inicia impresion en oPrn previo // este es el PRINTER
if oPrn==NIL
DBGoTo(nReg)
return NIL
endif
selecciona hoja 1 en oPrn
inicia pagina
nAncho:=132
DEFINE FONT oFont NAME "ARIAL" SIZE 0,-26 BOLD
nSup:=0
for n:=nIni to nFin
if !DBSeek(Ceros(n,8))
loop
endif
@ LINEA nSup+1,08,nSup+21,138 caja en oPrn
if File('C:\AUTOSYS\DATOS\ARREND\001\RECIBOS.BMP')
nR:=1+(nSup*CML)
nC:=2
oPrn:Cmtr2Pix(@nR,@nC)
oPrn:SayImage(nR,nC,'C:\AUTOSYS\DATOS\ARREND\001\RECIBOS.BMP',PosX(2,oPrn),PosY(2,oPrn))
endif
@ nSup+ 2, 0 dato 'KARLA AIDE HERRERA PULIDO' titulo 3,80 en oPrn
@ nSup+ 3, 0 dato 'RECIBO DE ARRENDAMIENTO' titulo 1,80 en oPrn
@ nSup+ 3,65 dato 'RECIBO NO. '+AllTrim(Str(Val(num_rec),8)) letra normal negrilla en oPrn
if sit_rec=='C'
@ nSup+ 4,63 dato 'CANCELADO' en oPrn
endif
@ nSup+ 7,60 dato 'BUENO POR $'+tran(imp_rec,'@Z 9999,999.99') letra normal negrilla en oPrn
@ LINEA nSup+10,19,nSup+10,132 en oPrn
if imp_rec>0
@ nSup+ 9,10 dato 'RECIBI DE '+ben_rec letra condensada en oPrn
else
@ nSup+ 9,10 dato 'RECIBI DE' letra condensada en oPrn
endif
@ LINEA nSup+12,26,nSup+12,132 en oPrn
if imp_rec>0
@ nSup+11,10 dato 'LA CANTIDAD DE $ ('+Upper(DescNum(imp_rec))+')' en oPrn
else
@ nSup+11,10 dato 'LA CANTIDAD DE $' en oPrn
endif
@ LINEA nSup+14,27,nSup+14,132 en oPrn
if imp_rec>0
@ nSup+13,10 dato 'POR CONCEPTO DE '+con_re1 en oPrn
else
@ nSup+13,10 dato 'POR CONCEPTO DE' en oPrn
endif
@ LINEA nSup+16,25,nSup+16,132 en oPrn
if imp_rec>0
@ nSup+15,10 dato 'LUGAR Y FECHA MORELIA, MICHOACAN, A '+FormaFecha(fec_rec,.t.) en oPrn
* @ nSup+15,10 dato 'LUGAR Y FECHA '+_CIUDAD+', '+_ESTADO+', A '+FormaFecha(fec_rec,.t.) en oPrn
else
@ nSup+15,10 dato 'LUGAR Y FECHA' en oPrn
endif
@ nSup+18,0 dato 'R E C I B I' titulo 0,80 en oPrn
@ LINEA nSup+20,31,nSup+20,51 NORMAL en oPrn
@ nSup+22, 10 dato '-' en oPrn
@ nSup+22,130 dato '-' en oPrn
nSup+=22
if nSup>=66
termina pagina
inicia pagina
nSup:=0
endif
next
termina pagina
termina impresion
OrdSetFocus(nOrdAnt)
DBGoTo(nReg)
DespVent(PantReci)
return NIL
y me da este error:
Path and name: I:\arrend\ARREND.exe (32 bits)
Size: 8,014,336 bytes
Compiler version: Harbour 3.2.0dev (r1803161710)
FiveWin Version: FWH 20.06
Windows version: 10.0, Build 19042
Time from start: 0 hours 0 mins 5 secs
Error occurred at: 08/12/2020, 14:16:35
Error description: Error BASE/1005 Message not found: TPRINTER:_LUSEHARUPDF
Args:
[ 1] = O TPRINTER
Stack Calls
===========
Called from: => __ERRRT_SBASE( 0 )
Called from: ../../../tobject.prg => TPRINTER:ERROR( 0 )
Called from: ../../../tobject.prg => (b)HBOBJECT( 0 )
Called from: ../../../tobject.prg => TPRINTER:MSGNOTFOUND( 0 )
Called from: ../../../tobject.prg => TPRINTER:_LUSEHARUPDF( 0 )
Called from: ARREND.PRG => IMPRIMIR( 209 )
Called from: ARREND.PRG => (b)RECMOVI( 103 )
Called from: .\source\classes\MENU.PRG => TMENU:COMMAND( 1556 )
Called from: .\source\classes\DIALOG.PRG => TDIALOG:COMMAND( 390 )
Called from: => TWINDOW:HANDLEEVENT( 0 )
Called from: .\source\classes\DIALOG.PRG => TDIALOG:HANDLEEVENT( 1136 )
Called from: => DIALOGBOXINDIRECT( 0 )
Called from: .\source\classes\DIALOG.PRG => TDIALOG:ACTIVATE( 304 )
Called from: MAUVENT.PRG => PROCFOLD( 2133 )
Called from: ARREND.PRG => RECMOVI( 130 )
Called from: ARREND.PRG => (b)MAIN( 62 )
Called from: .\source\classes\MENU.PRG => TMENU:COMMAND( 1556 )
Called from: .\source\classes\WINDOW.PRG => TWINDOW:COMMAND( 1141 )
Called from: => TWINDOW:HANDLEEVENT( 0 )
Called from: .\source\classes\WINDOW.PRG => _FWH( 3559 )
Called from: => WINRUN( 0 )
Called from: .\source\classes\WINDOW.PRG => TWINDOW:ACTIVATE( 1097 )
Called from: ARREND.PRG => MAIN( 72 )