Boa tarde, pessoal, Leonardo....
Preciso das funções abaixo, para testar o código postado acima pelo Leonardo.
Certamente elas fazem parte de arquivos . LIB e .CH
Alguém pode disponoibilizar pra mim ?
Eu uso o Xharbour 1.0.0 e Borland 5.0
xHarbour Compiler build 1.0.0 (SimpLex)
Compiling 'xvsigt.prg'...
Turbo Incremental Link 5.00 Copyright (c) 1997, 2000 Borland
Error: Unresolved external '_HB_FUN_PDFNEW' referenced from D:\MAX\XVSIGT\GERAPDF.OBJ
Error: Unresolved external '_HB_FUN_PDFSTARTPAGE' referenced from D:\MAX\XVSIGT\GERAPDF.OBJ
Error: Unresolved external '_HB_FUN_HB_SETLANDSCAPE' referenced from D:\MAX\XVSIGT\GERAPDF.OBJ
Error: Unresolved external '_HB_FUN_PDFDRAWPAGE' referenced from D:\MAX\XVSIGT\GERAPDF.OBJ
Error: Unresolved external '_HB_FUN_PDFENDPAGE' referenced from D:\MAX\XVSIGT\GERAPDF.OBJ
Error: Unresolved external '_HB_FUN_PDFEND' referenced from D:\MAX\XVSIGT\GERAPDF.OBJ
abaixo, a função completa postada pelo Leonardo
*******************************
Function GERA_PDF(cARQ, vABRE )
*******************************
PRIVATE oDlgHabla:=NIL
MsgRun("Aguarde Gerando Documento PDF...")
cText := memoread( cArq )
nLines := mlcount( cText, 150 )
cFileToSave := "meupdf.pdf" // nome do PDF
#ifdef __XHARBOUR__
Private AMSG := {}, CIMG
set(105,1)
set(106,1)
vAUTOR=""
PdfNew(cFileToSave,6,842,595,1,20,,,)
PdfStartPage( {vAUTOR} , .T. )
HB_SETLANDSCAPE(.T.)
for nA := 1 to nLines
cLinha := memoline( cText, 150, nA, 1, .F. )
Aadd(AMSG,cLinha)
next
PdfDrawPage( AMSG )
PdfEndPage()
PdfEnd()
#else
Private page, height, width, def_font, font
Private pdf := HPDF_New()
if pdf == NIL
Fim_Run()
msgstop( " Erro ao tentar gerar o Arquivo Pdf, Favor Tente novamente","Aviso do Sistema" )
Return("")
endif
/* set compression mode */
HPDF_SetCompressionMode( pdf, HPDF_COMP_ALL )
*HPDF_SetPassword(pdf, "senha","leonardo" ) // colocar senha no PDF
page := HPDF_AddPage(pdf)
height := HPDF_Page_GetHeight(page)
width := HPDF_Page_GetWidth(page)
def_font := HPDF_GetFont( pdf, "Helvetica", NIL )
HPDF_Page_BeginText( page )
HPDF_Page_MoveTextPos( page, 10, height - 10 )
vCONT=0
for nA := 1 to nLines
cLinha := memoline( cText, 150, nA, 1, .F. )
font := HPDF_GetFont( pdf, "Courier" , NIL )
HPDF_Page_SetFontAndSize( page, def_font, 7 )
HPDF_Page_SetFontAndSize( page, font, 7 )
HPDF_Page_ShowText( page, cLinha )
HPDF_Page_MoveTextPos( page, 0, -10 )
vCONT=vCONT+1
IF vCONT=80
page := HPDF_AddPage(pdf)
HPDF_Page_SetLineWidth(page, 1)
HPDF_Page_BeginText( page )
HPDF_Page_MoveTextPos( page, 10, height - 10 )
vCONT = 0
ENDIF
next
HPDF_Page_EndText( page )
HPDF_SaveToFile( pdf, cFileToSave )
HPDF_Free( pdf )
#endif
Fim_Run()
IF vABRE="S"
Abre_arquivo( cFileToSave ) //aqui ele mostra na tela o PDF gerado
ENDIF
Return(cFileToSave)