Problema con HaruPDF

Moderator: Rathinagiri

User avatar
andyglezl
Posts: 1461
Joined: Fri Oct 26, 2012 7:58 pm
Location: Guadalajara Jalisco, MX
Contact:

Re: Problema con HaruPDF

Post by andyglezl »

Gracias IMATECH y Pablo Cesar, con esto se soluciona !
_HMG_HPDF_SetEncoding ("ISO8859-3") .
porque con _HMG_HPDF_SetEncoding(WinAnsiEncoding) me da error en
"WinAnsiEncoding", me faltara un Include ?

claro, hay que seguir utilizando HB_OEMTOANSI()

-----------------------------------------------
Thanks IMATECH and Pablo Cesar, this solves!
_HMG_HPDF_SetEncoding ("ISO8859-3").
because _HMG_HPDF_SetEncoding (WinAnsiEncoding) gives me error
"WinAnsiEncoding", Include me missing one?

course, we must continue using HB_OEMTOANSI()
Andrés González López
Desde Guadalajara, Jalisco. México.
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

Problema con HaruPDF

Post by Pablo César »

andyglezl wrote:con _HMG_HPDF_SetEncoding(WinAnsiEncoding) me da error en
"WinAnsiEncoding", me faltara un Include ?
Ohhh disculpa, poné WinAnsiEncoding entre aspas. Es lo que está faltando.

---

Ohhh sorry, pls put WinAnsiEncoding between blades. It's what's missing.
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
User avatar
HASA
Posts: 44
Joined: Sat Feb 23, 2013 3:00 pm
Location: SÃO PAULO - BRAZIL

Re: Problema con HaruPDF

Post by HASA »

Buenas tardes Pablo y otros colegas que acompañan este post puede haber creado un malentendido porque yo uso la EXTEND MiniGUI y el personal no proporcionado o el ejemplo que fue tomado de la HMG archivo HMG_PDF.PRG tiene algunas líneas de código para oFont: HPDF_GetFont = (_HMG_HPDFDATA [1] [1], CFont, NIL), después de mucho puntas de prueba de sus colegas compararon otro ejemplo de impresión que utiliza HARUPDF como base y descubrió que en vez de NIL usan "CP1252", por lo que cambió todas las llamadas fuentes de oFont: = HPDF_GetFont (_HMG_HPDFDATA [1] [1], CFont, "CP1252"), y supongo que lo que "BINGO" dio correctamente, en el ejemplo con el Extend MiniGUI ha function () _HMG_HPDF_SetEncoding y destacó, por lo que decidí comparar línea por línea y funcionó, gracias a otros compañeros que trataron de ayudar y es un consejo para otros, este "CP1252" no sé si es por PORTUGUÉS, pero ... trabajado
:D
HASA


Good afternoon Pablo and other colleagues that accompany this post I may have created some misunderstanding because I use the EXTEND MiniGUI and staff there provided or example that was borrowed from HMG HMG_PDF.PRG file has some lines of code so oFont: HPDF_GetFont = (_HMG_HPDFDATA [1] [1], CFont, NIL) after much testing tips from colleagues compared another example of printing that uses HARUPDF as a base and discovered that instead of NIL they use "CP1252", so I changed all the calls sources for oFont: = HPDF_GetFont (_HMG_HPDFDATA [1] [1], CFont, "CP1252"), and guess what "BINGO" gave correctly, in the example with the Extend MiniGUI has _HMG_HPDF_SetEncoding function () and stressed, so I decided to compare line by line and it worked, thanks to other colleagues who tried to help and is a tip for others, this "CP1252" I do not know if it's for PORTUGUESE, but ... worked
:D
HASA
EduardoLuis
Posts: 682
Joined: Tue Jun 04, 2013 6:33 pm
Location: Argentina

Re: Problema con HaruPDF

Post by EduardoLuis »

Hi Hasa:

Try this (it works perfectly for me under HMG 3.046)


After the instruction:

START HPDFDOC

I insert this line:

SET HPDFDOC ENCODING TO "CP1252"

And thats all.-

Be aware that ANSI char does not work well under HMG 3.10 or later.-
If you are using HMG 3.10 or later, perform HPDF.EXE with HMG 3.046 and call this exe from your principal.EXE (made with HMG 3.13).- This method works well for me.-
I hope this will be usefull for you.
Eduardo.
User avatar
jairpinho
Posts: 420
Joined: Mon Jul 18, 2011 5:36 pm
Location: Rio Grande do Sul - Brasil
Contact:

Re: Problema con HaruPDF

Post by jairpinho »

external source when using only the first line arrow

@ 15, 18 HPDFPRINT cNome FONT cFonte1 size 15 COLOR { 50, 5, 255 } // CENTER
@ 23, 12 HPDFPRINT cEndereco FONT cFonte1 size 12 COLOR { 0, 0, 0 } // CENTER   does not work

Code: Select all

function CRIA_PDF()
   local lSuccess := .f.
   local cLB := chr( 10 )
   lOCAL cArquivo := "OFERTA.pdf" 
   Local cFonte1:= "Arialbd.ttf"
   

  
   SELECT HPDFDOC cArquivo TO lSuccess papersize HPDF_PAPER_A4
   SET HPDFDOC COMPRESS ALL
   SET HPDFDOC PAGEMODE TO OUTLINE
   SET HPDFINFO AUTHOR      TO 'Jair Pinho'
   SET HPDFINFO CREATOR     TO 'Jair Pinho'
   SET HPDFINFO TITLE       TO 'OFERTA'
   SET HPDFINFO SUBJECT     TO 'Criado com LibHaru/HPDF Library'
   SET HPDFINFO KEYWORDS    TO 'HMG, HPDF, Documentation, LibHaru, Harbour, MiniGUI'
   SET HPDFINFO DATECREATED TO date() TIME time()
   SET HPDFDOC ENCODING TO "WinAnsiEncoding"

   if lSuccess
      
        START HPDFPAGE
            SET HPDFDOC PAGEOUTLINE TITLE "Oferta" 
            // Draw_HeaderBox()
            // Print_Header( "HMG_HPDF Introduction" )
      
         *--------------- Rectangulo com Sombra e Dados do Remetente -----------*
@ 8, 10 HPDFPRINT RECTANGLE TO 47, 120 PENWIDTH 0.2 COLOR { 0, 0, 0 } 

         cNome     := "TechWorks Automações & TI"
         cEndereco  := "RUA ERNESTO GOMES"

         
         
        @ 15, 18 HPDFPRINT cNome FONT cFonte1 size 15 COLOR { 50, 5, 255 } // CENTER
        @ 23, 12 HPDFPRINT cEndereco FONT cFonte1 size 12 COLOR { 0, 0, 0 } // CENTER
       
      END HPDFDOC
   endif 
    
    execute file cArquivo
   
return nil  

Jair Pinho
HMG ALTA REVOLUÇÃO xBASE
HMG xBASE REVOLUTION HIGH
http://www.hmgforum.com.br
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: Problema con HaruPDF

Post by Rathinagiri »

This is a bug in the HMG HPDF library. Fonts once registered need not be registered again. I will fix this soon. Thanks for reporting.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

HMG 3.1.4 (Test)

Post by Pablo César »

EduardoLuis wrote:Rati: i've tested HMGDOC and as in previous versions except 3.46 it's not possible to put / print spanish characters.- Till now this is the only bug i found.-
Hi Eduardo ! Could you be more specific ? I do not understand. I did not found HMGDOC sample, which one ? Are you refering about this ?

Hola Eduardo, poderias ser más específico por favor ? No entendi en cual ejemplo te baseas. Seria C:\hmg.3.1.4\hfcl\Samples\HMGHPDFDoc\demo.Prg, este ?

Te refieres a esto ?
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
EduardoLuis
Posts: 682
Joined: Tue Jun 04, 2013 6:33 pm
Location: Argentina

Re: HMG 3.1.4 (Test)

Post by EduardoLuis »

Hola PabloCesar:

En efecto, quise sintetizar el comentario.-
En el HMGPDFDOC, sigue presentándose el mismo problema que en las versiones 3.1X, cuando intentas imprimir caracteres en español, son sustituidos por caracteres gráficos no ANSI, no importa si son parte de la definición del formulario o un dato proveniente de una tabla.-
La utilidad HMGPDFDOC es extraordinaria, por lo que la he investigado mucho desde que Rati la puso en el foro, y lo adopté como método único para todas las salidas de impresión de mis desarrollos.- En la versión 3.046 funciona perfecto, por lo que todo proceso de datos lo desarrollo bajo HMG 3.1X y solo la impresión bajo HMG 3.046, al menos mientras la incompatibilidad continue.- No es lo ideal, pero funciona.-
Espero haber aclarado mi error.-
Un abrazo. Eduardo

Hi PabloCesar:

You are right; my mistake becomes from trying to sintesize my comment.
As in previous versions 3.1X, when you try to print spanish characters, this ones are substituted by graphics different from ANSI ones, no mather if those characters are part of the form or becoming from a database (table).-
Since Rati upload HMGPDFDOC, one of the best tools for HMG, i've investigate it in deep, and choose it to perform all printing routines on my developes.-
HMGPDFDOC under HMG 3.046 works perfectly, so i decide to develope and EXE only for printing routines.- I know this is not the right way, but it works fine.-
Hopping i'll put crystal clear on my comment, with regards, Eduardo.-
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

Re: HMG 3.1.4 (Test)

Post by Pablo César »

Hola Eduardo, ya tentaste con: _HMG_HPDF_SetEncoding ("ISO8859-3") o _HMG_HPDF_SetEncoding("WinAnsiEncoding") ? Leíste este mensaje ? Y debo creer que tambien habrás cambiado la codificacion en tu editor de texto para UTF-8 ? Compilá y decinos si te funcionó...

--

Hi Eduardo, did you tried with: _HMG_HPDF_SetEncoding ("ISO8859-3") or _HMG_HPDF_SetEncoding("WinAnsiEncoding") ? Have you read this message ? I should believe that you have already changed your source editor to UTF-8 ? Build it and tell us if it have worked...
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
EduardoLuis
Posts: 682
Joined: Tue Jun 04, 2013 6:33 pm
Location: Argentina

Re: HMG 3.1.4 (Test)

Post by EduardoLuis »

Hola PabloCésar:

En efecto ya había realizado el test cuando publicaron ese post, y el resultado fue negativo.-
Adjunto archivo JPG con el resultado.- Los caracteres en castellano incluidos fueron ñ Ñ á é í ó y ú, en ese exacto orden.-
Tampoco tomó el seteo que utilizo en HMG 3.046 ó sea:
SET HPDFDOC ENCODING TO "CP1252" y el resultado fue el mismo.-
Un abrazo. Eduardo

Hi PabloCésar:

I've test the suggestion post, but the result was also negative.-
I attach JPG file where i show PDF result.-
Characters in spanish includes on PDF file where: ñ Ñ á é í and ú in that exact order.-
I also tried encoding i'm using under HMG 3.046, for example:
SET HPDFDOC ENCODING TO "CP1252" and the result was the same.-
With regards. Eduardo
Attachments
HMGPDFDOC ON HMG 314.JPG
HMGPDFDOC ON HMG 314.JPG (39.26 KiB) Viewed 9276 times
Post Reply