It's seems that HMG_HPDF doesn't support unicode


Is this correct and if so may be a hope for the future ?
Regards
Moderator: Rathinagiri
Code: Select all
cText_hbHpdf := hb_Translate( c_AnyString, 'UTF8EX', cMyCodePage )
Thank Ronaldo, I will prob it.IMATECH wrote: I see no problem
Code: Select all
cText_hbHpdf := hb_Translate( c_AnyString, 'UTF8EX', cMyCodePage )
Code: Select all
c_file_name_for_pdf_File := hb_Translate( c_AnyString, 'UTF8EX', cMyCodePage )
This is my SSW :esgici wrote: It's seems that HMG_HPDF doesn't support unicode![]()
![]()
Code: Select all
/*
Exploring UTF8 implementation in HMG_HPDF
*/
#include "hmg.ch"
#include "hfcl.ch"
PROCEDURE Main()
cSourceFileName := "español.txt"
cSourceText := HB_MEMOREAD( cSourceFileName )
cTargetFileName := STRTRAN( cSourceFileName, "txt", "pdf" )
SELECT HPDFDOC ( cTargetFileName ) TO lSelPDF // papersize HPDF_PAPER_A4
IF lSelPDF
START HPDFDOC
START HPDFPAGE
@ 20, 20 HPDFPRINT cSourceText
END HPDFPAGE
END HPDFDOC
IF FILE( cTargetFileName )
MsgInfo( "PDF Builded as " + cTargetFileName )
ELSE
MsgStop( "PDF Building Unsuccessful :(", "Unexpected ERROR !" )
ENDIF FILE( cTargetFileName )
ENDIF lSelPDF
RETURN // BTExplore.Main()
*-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.
Thanks to clarification my brother,Rathinagiri wrote: As of now we can't use unicode with HPDF.
Claudio had also tested in a newer version of HPDF for unicode. We are investigating this and it is a main agenda for the upcoming versions.
Code: Select all
#include "hmg.ch"
#include "hfcl.ch"
PROCEDURE Main()
cSourceFileName := "español.txt"
cSourceText := hb_Translate( HB_MEMOREAD( cSourceFileName ), 'UTF8EX', 'ESISO' )
cTargetFileName := STRTRAN( cSourceFileName, "txt", "pdf" )
SELECT HPDFDOC ( hb_Translate( cTargetFileName, 'UTF8EX', 'ESISO' ) ) TO lSelPDF // papersize HPDF_PAPER_A4
IF lSelPDF
_HMG_HPDF_SetEncoding( "WinAnsiEncoding" )
START HPDFDOC
START HPDFPAGE
@ 20, 20 HPDFPRINT cSourceText
END HPDFPAGE
END HPDFDOC
IF FILE( cTargetFileName )
MsgInfo( "PDF Builded as " + cTargetFileName )
ELSE
MsgStop( "PDF Building Unsuccessful :(", "Unexpected ERROR !" )
ENDIF FILE( cTargetFileName )
ENDIF lSelPDF
RETURN
// *---------------------------------------------------------------------------*
// hb_gtsys()
// *---------------------------------------------------------------------------*
PROCEDURE hb_gtsys()
REQUEST HB_LANG_ES
REQUEST HB_CODEPAGE_ESISO
RETURN