// {% hb_SetEnv( "HB_INCLUDE", "C:\hb30web\include" ) %}
STATIC aTtfFontList:= NIL
STATIC cFontDir
//--- problemas con cos,sin
function Main()
local def_font, tw, i := 0
local cPageTitle := "Title of the page"
local font_list := { "Courier", "Courier-Bold", "Courier-Oblique", "Courier-BoldOblique",;
"Helvetica", "Helvetica-Bold", "Helvetica-Oblique", "Times-Roman",;
"Times-Bold", "Times-Italic", "Times-BoldItalic", "Symbol", "ZapfDingbats" }
local oPrn
oPrn := TPdf():New( "list" )
oPrn:LoadedFonts := font_list
if Empty( oPrn:hPdf )
? "PDFs not available!"
return NIL
endif
oFont1 := oPrn:DefineFont( 'Helvetica', 24 )
oFont3 := oPrn:DefineFont( 'Helvetica', 16 )
oFont2 := oPrn:DefineFont( 'Helvetica-Bold', 16 )
oPrn:StartPage()
height := oprn:nVertSize()
width := oprn:nHorzSize()
oPrn:Rect( 10, 10, height-20, width-20 , 1 )
oPrn:cmSay( 2, 7, cPageTitle, oFont1 )
x = 90
for n = 1 to Len( font_list )
samp_text = "abcdefgABCDEFG12345!#$%&+-@?"
oFont2 = oPrn:DefineFont( font_list[ n ], 16 )
oPrn:Say( x + n * 40, 30, font_list[ n ], oFont2 )
oPrn:Say( x + n * 40, 220, samp_text, oFont2 )
next
oPrn:EndPage()
oPrn:Save( hb_GetEnv( "PRGPATH" ) + "/test2.pdf" )
oPrn:end()
?? "<iframe src='test2.pdf' style='width:calc( 100% + 16px );height:100%;border:0px;margin:-8px;'></iframe>"
return nil
Users browsing this forum: No registered users and 13 guests