I'm trying to create PDF files from my application, and I found an error, I think.
Problem occurs when
@ r1,c1 HPDFPRINT TO r2,c2 method is called with declared font name.
Any .pdf file is not created.
@ 130, 10 HPDFPRINT "This is a sample Text in BOLD and ITALIC AND GREEN" ;
TO 130,30 FONT "COURIER-NEW" SIZE 6 BOLD ITALIC COLOR {0,200,0}
sample:
Code: Select all
#include "hmg.ch"
Function Main()
cFileName := TempFile(".","pdf",0)
SELECT HPDFDOC cFileName PAPERLENGTH 300 PAPERWIDTH 300 LOG
START HPDFDOC
START HPDFPAGE
SET HPDFDOC ENCODING TO "CP1250"
@ 10, 10 HPDFPRINT "this is file: "+ cFileName FONT "ARIAL" SIZE 20 BOLD
//working phrase
@ 110, 10 HPDFPRINT "This is a sample Text in BOLD and ITALIC AND GREEN" ;
TO 130,30 SIZE 6 BOLD ITALIC COLOR {0,200,0}
//if you uncomment this phrase, any pdf will be created
// @ 130, 10 HPDFPRINT "This is a sample Text in BOLD and ITALIC AND GREEN" ;
// TO 130,30 FONT "COURIER-NEW" SIZE 6 BOLD ITALIC COLOR {0,200,0}
END HPDFPAGE
END HPDFDOC
Execute File cFileName
Return Nil
When you omit
FONT "COURIER-NEW" phrase, everything goes OK.