Trato de Ejecutar en reporte con la clase TPDF, y me genera este error
Antes funcionaba bien,
- Code: Select all Expand view
Application
===========
Path and name: K:\v_xharb_v3\Pruebas Varias\tpdf\ejemplo4.exe (32 bits)
Size: 4,556,288 bytes
Compiler version: Harbour 3.2.0dev (r2403071241)
FiveWin version: FWH 20.12
C compiler version: Borland/Embarcadero C++ 7.7 (32-bit)
Windows version: 6.2, Build 9200 (Windows 11)
Time from start: 0 hours 0 mins 2 secs
Error occurred at: 06/09/24, 18:23:29
Error description: Error BASE/1004 Message not found: TPDF:PDFNEWPAGE
Args:
[ 1] = O TPDF
Stack Calls
===========
Called from: ../../../tobject.prg => __ERRRT_SBASE( 0 )
Called from: ../../../tobject.prg => TPDF:ERROR( 0 )
Called from: ../../../tobject.prg => (b)HBOBJECT( 0 )
Called from: ../../../tobject.prg => TPDF:MSGNOTFOUND( 0 )
Called from: ../../../tobject.prg => TPDF:PDFNEWPAGE( 0 )
Called from: ejemplo4.prg => CREAPDFCC( 36 )
Called from: ejemplo4.prg => (b)MAIN( 11 )
Called from: .\source\classes\MENU.PRG => TMENU:COMMAND( 1560 )
Called from: .\source\classes\WINDOW.PRG => TWINDOW:COMMAND( 1141 )
Called from: .\source\classes\WINDOW.PRG => TWINDOW:HANDLEEVENT( 0 )
Called from: .\source\classes\WINDOW.PRG => _FWH( 3559 )
Called from: .\source\classes\WINDOW.PRG => WINRUN( 0 )
Called from: .\source\classes\WINDOW.PRG => TWINDOW:ACTIVATE( 1097 )
Called from: ejemplo4.prg => MAIN( 16 )
Este es el Codigo
- Code: Select all Expand view
#include "FiveWin.ch"
#include "PdfHbDoc.ch"
Static oWnd, n
Function Main()
Local oMenu
MENU oMenu
MENUITEM "My First Pdf" ACTION creapdfcc()
MENUITEM "Exit" ACTION oWnd:End
ENDMENU
DEFINE WINDOW oWnd MENU oMenu
ACTIVATE WINDOW oWnd MAXIMIZED
Return Nil
function creapdfcc()
local dresult // := DEHASTA()
local cImpdos
local oprn
local nsaldo := 0
local nvalor := 0
local z := 0
local cPath := "C:\PDF\MEUPDF.pdf"
local oPdf
local ntotal := 0
n := 2.9
opdf := tpdf():new(cPath)
opdf:Pdfnewpage("A4","P")
opdf:Pdfimage(".\QRCODE.jpg", cm2dpi(2.5), 0,85,66)
opdf:Pdfatsay("QUÍMICA MEGA SA",cm2dpi( .7 ),100,.T.)
oPdf:Pdfatsay("Matanza 1456/58",cm2dpi( 1.2 ),100,.T.)
oPdf:Pdfatsay("Avellaneda-Pcia Bs As",cm2dpi( 1.6 ),100,.T.)
oPdf:Pdfatsay("T.E.: 4289-2700(Rotativas)",cm2dpi( 2.0 ),100,.T.)
oPdf:Pdfatsay(replicate("_",115),cm2dpi( 2.5 ),10,.T.)
opdf:Pdfclosepage()
opdf:pdfclose()
msginfo("Archivo creado con éxito","Aviso del sistema")
/*
if !empty(cmail)
correo(cMail,,("Enviamos resumen de cuenta desde " + transform(dresult[1],"@d") + " hasta " + transform(dresult[1],"@d") ),"Resumen de cuenta", alltrim(cPath ) )
endif
*/
ShellExecute( oWnd:hWnd, "open", "c:\pdf\meupdf.pdf" )
return .t.
/*******************************************************************************/
function cm2dpi( nCM, page, lHeight )
Local nHeight,nDpi := 72
Local nRes
if empty( lHeight )
lHeight := .T.
endif
if lHeight
nHeight := 842.0
nRes := nHeight - ( nCM * nDpi / 2.54 )
else
nRes := ( nCM * nDpi / 2.54 )
endif
return nRes
#pragma BEGINDUMP
int _streams;
#pragma ENDDUMP