ErrorIMATECH wrote:Hi Esgici !
Adjusted ( but not tested ! )
..... ...
Regards
Unicode and HMG_HPDF
Moderator: Rathinagiri
Re: Unicode and HMG_HPDF
- Attachments
-
- err.JPG (11.31 KiB) Viewed 13007 times
BPD
Convert Dream into Reality through HMG
Convert Dream into Reality through HMG
- esgici
- Posts: 4543
- Joined: Wed Jul 30, 2008 9:17 pm
- DBs Used: DBF
- Location: iskenderun / Turkiye
- Contact:
Re: Unicode and HMG_HPDF
I tested :IMATECH wrote: Adjusted ( but not tested ! )
Two REQUEST moved to before Main()
hb_gtsys() moved to after Main()
PROCEDURE() ( and its RETURN ) lines commented;
and the result ( same as Dave's ) :
Error BASE/1302 Argument error: HB_TRANSLATE
Called from HB_TRANSLATE(0)
Called from MAIN(24) -> SELECT HPDFDOC ( hb_Translate( cTarget...
Regards
Viva INTERNATIONAL HMG
Re: Unicode and HMG_HPDF
Hi Esgici, bdp !
Adjusted
and
Tested ( Works ok )
Harbour uses last libHaru sources ( 2.3.0RC2 ) supporting 1~2 bytes UTF8 codes
Then HMG_hbHpdf can be updated to use these new resources
Code Template:
Regards
Adjusted
and
Tested ( Works ok )
#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
Harbour uses last libHaru sources ( 2.3.0RC2 ) supporting 1~2 bytes UTF8 codes
Then HMG_hbHpdf can be updated to use these new resources
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" )
Last edited by IMATECH on Thu Nov 07, 2013 9:57 pm, edited 1 time in total.
M., Ronaldo
By: IMATECH
Imation Tecnologia
By: IMATECH
Imation Tecnologia
- esgici
- Posts: 4543
- Joined: Wed Jul 30, 2008 9:17 pm
- DBs Used: DBF
- Location: iskenderun / Turkiye
- Contact:
Re: Unicode and HMG_HPDF
Hola Ronaldo,IMATECH wrote: Adjusted
and
Tested ( Works ok )
yes; tested, works ok
Thank you very much
Two little question ( if no problem )
- . español .OR. espãnol; which one is correct ? ( It cost me two hours )
. how a function ( hb_gtsys ) runs without calling
Not only problem solved, but for everything increased my knowledge
As Daniel said : everybody learns something by every post !
Viva HMG
Viva INTERNATIONAL HMG
Re: Unicode and HMG_HPDF
Hi Esgici !
. español .OR. espãnol ( just a wrong backspace: shit happens )
Sorry, I don't know nothing about spanish language rules
. hb_gtsys
It's a default behavior for any Harbour GT
. 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, ... )
. everybody learns something by every post !
Some times by every re-edited posts too
Then my posts can be readed again and again...
Regards
. español .OR. espãnol ( just a wrong backspace: shit happens )
Sorry, I don't know nothing about spanish language rules
. hb_gtsys
It's a default behavior for any Harbour GT
. 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, ... )
. everybody learns something by every post !
Some times by every re-edited posts too
Then my posts can be readed again and again...
Regards
M., Ronaldo
By: IMATECH
Imation Tecnologia
By: IMATECH
Imation Tecnologia
- esgici
- Posts: 4543
- Joined: Wed Jul 30, 2008 9:17 pm
- DBs Used: DBF
- Location: iskenderun / Turkiye
- Contact:
Re: Unicode and HMG_HPDF
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, ... )
Your good news and suggestions about HaruPDF and UT8 is more important than my asked problem,
thanks a lot for this also
Hopefully forum management will take into account your guidance
Regarding re-editing posts, my humble opinion is:
forum software don't allow deleting answered posts;
this rule must apply to editing posts too, I think.
Because some people abusing it; uses posts as a scratchpad,
and will be very difficult to follow the subjects.
For example, corrects an his erroneous sentences after someone warn it
Anyway, thanks to everything and
Viva HMG
Viva INTERNATIONAL HMG
Re: Unicode and HMG_HPDF
Hi quartz !
It's for you
image pdf using Arial.ttf font
Regards
It's for you
image pdf using Arial.ttf font
Regards
M., Ronaldo
By: IMATECH
Imation Tecnologia
By: IMATECH
Imation Tecnologia
Re: Unicode and HMG_HPDF
Thank you Ronaldo,IMATECH wrote:Hi quartz !
It's for you
image pdf using Arial.ttf font
Regards
Add following 2 line to run above example
#define HPDF_COMP_ALL 0x0F
REQUEST HB_GT_WIN_DEFAULT
Regards
BPD
Convert Dream into Reality through HMG
Convert Dream into Reality through HMG
Re: Unicode and HMG_HPDF
Thank you very much Ronaldo. It works perfectly!
Thanks all !
Thanks all !
- Attachments
-
- ABGD.png (4.14 KiB) Viewed 12888 times
Best Regards,
Nikos.
os: Windows Server 2019 - 64
Nikos.
os: Windows Server 2019 - 64
Re: Unicode and HMG_HPDF
Hi !
Esgici, DanielMaximiliano, BPD and Nikos
Thanks for interest and feedback
Best regards
Esgici, DanielMaximiliano, BPD and Nikos
Thanks for interest and feedback
Best regards
M., Ronaldo
By: IMATECH
Imation Tecnologia
By: IMATECH
Imation Tecnologia