Re: Unicode and HMG_HPDF
Posted: Thu Nov 07, 2013 2:56 pm
ErrorIMATECH wrote:Hi Esgici !
Adjusted ( but not tested ! )
..... ...
Regards
Exclusive forum for HMG, a Free / Open Source xBase WIN32/64 Bits / GUI Development System
http://hmgforum.com/
ErrorIMATECH wrote:Hi Esgici !
Adjusted ( but not tested ! )
..... ...
Regards
I tested :IMATECH wrote: Adjusted ( but not tested ! )
#include "hmg.ch"
#include "hfcl.ch"
PROCEDURE Main()
LOCAL i
LOCAL lSelPDF
LOCAL aSourceText
LOCAL cSourceFileName
LOCAL cTargetFileName
hb_langSelect( 'es' )
hb_cdpSelect( "UTF8EX" )
cSourceFileName := "espãnol.txt"
aSourceText := hb_aTokens( hb_Translate( HB_MEMOREAD( cSourceFileName ), 'UTF8EX', 'ESISO' ), CHR(10) )
cTargetFileName := STRTRAN( cSourceFileName, "txt", "pdf" )
SELECT HPDFDOC ( hb_Translate( cTargetFileName, 'UTF8EX', 'ESISO' ) ) TO lSelPDF
IF lSelPDF
_HMG_HPDF_SetEncoding( "WinAnsiEncoding" )
START HPDFDOC
START HPDFPAGE
FOR i := 1 TO Len( aSourceText )
@ ( i * 4 )+15, 20 HPDFPRINT aSourceText[ i ]
NEXT
END HPDFPAGE
END HPDFDOC
IF FILE( cTargetFileName )
MsgInfo( "PDF Builded as " + cTargetFileName )
ELSE
MsgStop( "PDF Building Unsuccessful ", "Unexpected ERROR !" )
ENDIF
ENDIF lSelPDF
RETURN
// *---------------------------------------------------------------------------*
// hb_gtsys()
// *---------------------------------------------------------------------------*
PROCEDURE hb_gtsys()
REQUEST HB_LANG_ES
REQUEST HB_CODEPAGE_ESISO
REQUEST HB_CODEPAGE_UTF8EX
RETURN
Code: Select all
libHaru 2.3.0RC2
Changed package naming, no other changes was done.
libHaru 2.3.0RC1
Added support for 3dMeasures of subtype PD3 and 3DC, projection annotations, ExData and javascript attached to a U3D model. (Robert Würfel)
Added support for 1- and 2-byte UTF8 codes. (Clayman)
Added full PDF/A1-b support. (Petr Pytelka)
Added support for CCITT compression for B/W images. (Petr Pytelka)
Add support for TwoPageLeft and TwoPageRight layouts. (Vincent Dupont)
Const-ified arrays used in the sources. (Ilkka Lehtoranta)
Fixed build with libpng 1.5.0
Fixed bug in HPDF_GetContents() - isize variable was not initialized. (Vincent Dupont)
Fixed possible endless loop in PNG handling code. (reported by Mathew Waters)
Fixed several issues based on the warnings generated by clang-analyzer. (Daniel Höpfl)
Fixed quite a number of warnings. (Davide Achilli)
Added 'd' postfix to debug build, fixed wrong filename. (Wim Dumon)
Fixed HPDF_Text_Rect() not to split words in some obscure cases.
http://libharu.org/
Code: Select all
/* UTF8 */
HPDF_UseUTFEncodings( oPdf )
/* Embend Font */
HPDF_LoadTTFontFromFile( oPdf, "Any.ttf", .T. )
/* oPdf Font */
HPDF_GetFont( oPdf, cFontName, "UTF-8" )
Hola Ronaldo,IMATECH wrote: Adjusted
and
Tested ( Works ok )
Yes, you are right,IMATECH wrote: . HPDF_UseUTFEncodings( oPdf )
After Sr.Rathinagiri just include this function to HMG_HPDF lib any language will be correct created inside pdf files ( japanese, greek, ... )
Thank you Ronaldo,IMATECH wrote:Hi quartz !
It's for you
image pdf using Arial.ttf font
Regards