Valeu Paulo!
Agora fechou.
Um abraço.
Rosalvo

Moderador: Moderadores
*******************************
Function GERA_PDF(vARQ, vABRE )
*******************************
cText := memoread( vARQ )
nLines := mlcount( cText, 150 )
cFileToSave := cARQPDF
Private page, height, width, def_font, font
Private pdf := HPDF_New()
if pdf == NIL
Aviso("Erro HBPDF tentar gerar o Arquivo Pdf, Favor Tente novamente")
Return("")
endif
/* set compression mode */
HPDF_SetCompressionMode( pdf, HPDF_COMP_ALL )
*HPDF_SetCompressionMode( pdf, HPDF_COMP_NONE ) // não funcionou, continua condensando
*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 )
IF upper(vABRE)="S"
**Abre_arquivo( cFileToSave ) // aqui dependendo já mando abrir o arquivo
ENDIF
HPDF_Free( pdf )
Return
HPDF_Page_SetFontAndSize( page, def_font, 7 )
HPDF_Page_SetFontAndSize( page, font, 7 )
HaruDoc::COMP_NONE - all contents is not compressed.
HaruDoc::COMP_TEXT - compress the text data.
HaruDoc::COMP_IMAGE - compress the image data.
HaruDoc::COMP_METADATA - compress other data (fonts, cmaps).
HaruDoc::COMP_ALL - compress all data.
Usuários vendo este fórum: Bing [Bot] e 5 visitantes