Unicode and HMG_HPDF

HMG Unicode versions 3.1.x related

Moderator: Rathinagiri

User avatar
esgici
Posts: 4253
Joined: Wed Jul 30, 2008 9:17 pm
Location: iskenderun / Turkiye
Has thanked: 132 times
Been thanked: 42 times
Contact:

Unicode and HMG_HPDF

Post by esgici » Wed Nov 06, 2013 10:47 pm

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: 167
Joined: Sun May 27, 2012 9:33 pm
Location: Brazil: Goiânia-GO.

Post by IMATECH » Wed Nov 06, 2013 11:05 pm

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: 4253
Joined: Wed Jul 30, 2008 9:17 pm
Location: iskenderun / Turkiye
Has thanked: 132 times
Been thanked: 42 times
Contact:

Post by esgici » Wed Nov 06, 2013 11:28 pm

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: 167
Joined: Sun May 27, 2012 9:33 pm
Location: Brazil: Goiânia-GO.

Post by IMATECH » Thu Nov 07, 2013 12:17 am

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: 1977
Joined: Fri Apr 09, 2010 4:53 pm
Location: Argentina
Has thanked: 11 times
Been thanked: 8 times
Contact:

Post by danielmaximiliano » Thu Nov 07, 2013 12:35 am

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

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp / Telegrams To cel +54 011 690 26 142

User avatar
esgici
Posts: 4253
Joined: Wed Jul 30, 2008 9:17 pm
Location: iskenderun / Turkiye
Has thanked: 132 times
Been thanked: 42 times
Contact:

Post by esgici » Thu Nov 07, 2013 11:32 am

Hi All
esgici wrote: It's seems that HMG_HPDF doesn't support unicode :( :?
This is my SSW :
UTF8HPDF.jpg
Results of this SSW
UTF8HPDF.jpg (36.04 KiB) Viewed 1499 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: 5040
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Has thanked: 78 times
Been thanked: 90 times
Contact:

Post by Rathinagiri » Thu Nov 07, 2013 11:36 am

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: 4253
Joined: Wed Jul 30, 2008 9:17 pm
Location: iskenderun / Turkiye
Has thanked: 132 times
Been thanked: 42 times
Contact:

Post by esgici » Thu Nov 07, 2013 11:39 am

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: 387
Joined: Mon Oct 01, 2012 12:37 pm
Location: Thessaloniki, Greece
Has thanked: 74 times
Been thanked: 7 times
Contact:

Post by quartz565 » Thu Nov 07, 2013 12:52 pm

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 1484 times
gia.png
gia.png (3.15 KiB) Viewed 1484 times
Best Regards,
Nikos.

os: Windows Server 2012 - 64
hw: HP Server E5606, 2.13GHz, 8.00 GB - Intel Xeon CPU

User avatar
IMATECH
Posts: 167
Joined: Sun May 27, 2012 9:33 pm
Location: Brazil: Goiânia-GO.

Post by IMATECH » Thu Nov 07, 2013 2:41 pm

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

Who is online

Users browsing this forum: No registered users and 1 guest