Unicode and HMG_HPDF

HMG Unicode versions 3.1.x related

Moderator: Rathinagiri

User avatar
esgici
Posts: 4543
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Contact:

Unicode and HMG_HPDF

Post by esgici »

Hi All

It's seems that HMG_HPDF doesn't support unicode :( :?

Is this correct and if so may be a hope for the future ?

Regards
Viva INTERNATIONAL HMG :D
User avatar
IMATECH
Posts: 188
Joined: Sun May 27, 2012 9:33 pm
Location: Brazil: Goiânia-GO.

Re: Unicode and HMG_HPDF

Post by IMATECH »

Hi Esgici !

I see no problem :)

Code: Select all

cText_hbHpdf := hb_Translate( c_AnyString, 'UTF8EX', cMyCodePage )
Regards
M., Ronaldo

By: IMATECH

Imation Tecnologia
User avatar
esgici
Posts: 4543
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Contact:

Re: Unicode and HMG_HPDF

Post by esgici »

IMATECH wrote: I see no problem :)

Code: Select all

cText_hbHpdf := hb_Translate( c_AnyString, 'UTF8EX', cMyCodePage )
Thank Ronaldo, I will prob it.

By the way my problem is on file name, not pdf text.

Regards
Viva INTERNATIONAL HMG :D
User avatar
IMATECH
Posts: 188
Joined: Sun May 27, 2012 9:33 pm
Location: Brazil: Goiânia-GO.

Re: Unicode and HMG_HPDF

Post by IMATECH »

Hi Esgici !


I Think you can use the same solution:

Code: Select all

c_file_name_for_pdf_File := hb_Translate( c_AnyString, 'UTF8EX', cMyCodePage )
Regards
M., Ronaldo

By: IMATECH

Imation Tecnologia
User avatar
danielmaximiliano
Posts: 2607
Joined: Fri Apr 09, 2010 4:53 pm
Location: Argentina
Contact:

Re: Unicode and HMG_HPDF

Post by danielmaximiliano »

Gracias Ronaldo por compartir sus conocimientos
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
User avatar
esgici
Posts: 4543
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Contact:

Re: Unicode and HMG_HPDF

Post by esgici »

Hi All
esgici wrote: It's seems that HMG_HPDF doesn't support unicode :( :?
This is my SSW :
Results of this SSW
Results of this SSW
UTF8HPDF.jpg (36.04 KiB) Viewed 10753 times
the code :

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()

*-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.
Any idea :?:

And, Ronaldo,

Would you like add your suggestions on this code,
( with required REQUEST statements and SETxxx commands / functions)
please.

Regards
Viva INTERNATIONAL HMG :D
User avatar
Rathinagiri
Posts: 5471
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: Unicode and HMG_HPDF

Post by Rathinagiri »

Esgici,

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.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
esgici
Posts: 4543
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Contact:

Re: Unicode and HMG_HPDF

Post by esgici »

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.
Thanks to clarification my brother,

you are UNIQUE :arrow:

With my best reagrds :D
Viva INTERNATIONAL HMG :D
User avatar
quartz565
Posts: 667
Joined: Mon Oct 01, 2012 12:37 pm
Location: Thessaloniki, Greece
Contact:

Re: Unicode and HMG_HPDF

Post by quartz565 »

Please do not forget the problem with the distance between the letters of the Greek words... :) :arrow:
Attachments
gia_code.png
gia_code.png (2.33 KiB) Viewed 10738 times
gia.png
gia.png (3.15 KiB) Viewed 10738 times
Best Regards,
Nikos.

os: Windows Server 2019 - 64
User avatar
IMATECH
Posts: 188
Joined: Sun May 27, 2012 9:33 pm
Location: Brazil: Goiânia-GO.

Re: Unicode and HMG_HPDF

Post by IMATECH »

Hi Esgici !


Adjusted ( but not tested ! )

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

Regards
M., Ronaldo

By: IMATECH

Imation Tecnologia
Post Reply