Underline and italic in PDF seems not work

Moderator: Rathinagiri

Post Reply
Italia1
Posts: 60
Joined: Mon Mar 24, 2014 10:55 am
Location: Italia

Underline and italic in PDF seems not work

Post by Italia1 »

Salve a tutti!
Vorrei creare un PDF con dei paragrafi sottolineati o in corsivo tramite il comando
@ <Row> , <Col> PRINT [ DATA ] <xData>
[ TO <nToRow> , <nToCol> ]
[ FONT <cFontName> ]
[ SIZE <nFontSize> ]
[ BOLD ]
[ ITALIC ]
[ UNDERLINE ]
[ STRIKEOUT ]
[ COLOR <aColor> ]
[ RIGHT | CENTER ]
ma l'opzione UNDERLINE e ITALIC sembrano non funzionare: dove sbaglio?

Se non fosse ancora stato attivato, leggo dal ChangeLog di HMG 2.1 Extended Edition basandosi sulla contribuzione di S.Rathinagiri e Janusz Pora sembrano stati corretti.
E' possibile in HMG 3.2(Stable) avere questa funzionalità?

Grazie comunque. W il vecchio Clipper e il nuovo HMG!

---------- english translate
Hello to everyone!

I want to create a PDF with paragraphs underlined or in italics using the command
@ <Row> , <Col> PRINT [ DATA ] <xData>
[ TO <nToRow> , <nToCol> ]
[ FONT <cFontName> ]
[ SIZE <nFontSize> ]
[ BOLD ]
[ ITALIC ]
[ UNDERLINE ]
[ STRIKEOUT ]
[ COLOR <aColor> ]
[ RIGHT | CENTER ]
but the option UNDERLINE and ITALIC seems not work: where am I wrong?

Had it not been activated yet, I read the ChangeLog HMG 2.1 Extended Edition based on the contribution of S.Rathinagiri and Janusz Pora seem to have been correct.
It's 'possible with HMG 3.2 (Stable) have this feature?

Thanks anyway. W old Clipper and the new HMG!

Edit
The problem could be in HMG_HPDF.PRG. In extended I read

Code: Select all

if lStrikeout .or. lUnderline
         HPDF_Page_SetLineWidth( _HMG_HPDFDATA[ 1 ][ 7 ], 1 )
         if lColor
            HPDF_Page_SetRGBStroke( _HMG_HPDFDATA[ 1 ][ 7 ], nRColor/255, nGColor/255, nBColor/255 )
         else
            HPDF_Page_SetRGBStroke( _HMG_HPDFDATA[ 1 ][ 7 ], 0.0, 0.0, 0.0 )
         endif
         nyPos += IF( lUnderline, -1, _HMG_HPDF_Pixel2MM(nFontSize)/2+1 )
         HPDF_Page_MoveTo( _HMG_HPDFDATA[ 1 ][ 7 ], nxPos, nyPos )
         HPDF_Page_LineTo( _HMG_HPDFDATA[ 1 ][ 7 ], nxPos + nTextWidth, nyPos )
         HPDF_Page_Stroke( _HMG_HPDFDATA[ 1 ][ 7 ] )
endif
in HMG 3.2 there's not the lStrikeout and lUnderline referred. The syntax it's different: _HMG_HPDFDATA[n][m] vs. _HMG_SYSDATA[n][m]
Bye
I use the great HMG3.2(stable). Have i nice international HMG to everyone!
Italia1
Posts: 60
Joined: Mon Mar 24, 2014 10:55 am
Location: Italia

Re: Underline and italic in PDF seems not work

Post by Italia1 »

Hello!

Have you thought about the problem of underline and italic in PDF with PRINT command? For underline a temporary solution is print a line under the words (the code of Extended Version does the same, but I don't know how translate in standard HMG 3.2 :oops: ), but I would like to have the UNDERLINE and ITALIC option in my PRINT if possibile :(

Bye

P.S. this is the right forum section :?:
I use the great HMG3.2(stable). Have i nice international HMG to everyone!
Javier Tovar
Posts: 1275
Joined: Tue Sep 03, 2013 4:22 am
Location: Tecámac, México

Re: Underline and italic in PDF seems not work

Post by Javier Tovar »

Hola Italia 1,

Podrías subir un demo mínimo completo para verificar su comportamiento?

Gracias

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////



Hello Italia 1,

You could climb a full minimum demo to verify their behavior?

thanks
Italia1
Posts: 60
Joined: Mon Mar 24, 2014 10:55 am
Location: Italia

Re: Underline and italic in PDF seems not work

Post by Italia1 »

Here it is, dear Javier Tovar!

Code: Select all

#include "hmg.ch"
#include "hmg_hpdf.ch"

FUNCTION MAIN()
	test:="test.pdf"
	SELECT PRINTER test TO lSuccess papersize PRINTER_PAPER_A4
	START PRINTDOC
	START PRINTPAGE
	@ 20,20 PRINT "I want this underline" UNDERLINE
	@ 40,20 PRINT "I want this italic" ITALIC
	@ 60,20 PRINT "I want this bold" BOLD
	@ 80,20 PRINT "I want this strikeout" STRIKEOUT
	@ 100,20 PRINT "I have HMG 3.2(stable)"
	END PRINTPAGE
	END PRINTDOC
	IF FILE( test )
		EXECUTE FILE test
	ENDIF
RETURN NIL
Thanks and regards! :)

P.S. I add my PDF but i don't see my attach :shock:
P.S.2. I add my PDF in 7zip
test.7z
My PDF
(650 Bytes) Downloaded 406 times
I use the great HMG3.2(stable). Have i nice international HMG to everyone!
User avatar
danielmaximiliano
Posts: 2607
Joined: Fri Apr 09, 2010 4:53 pm
Location: Argentina
Contact:

Re: Underline and italic in PDF seems not work

Post by danielmaximiliano »

Italia1 wrote: P.S. I add my PDF but i don't see my attach :shock:
P.S.2. I add my PDF in 7zip
test.7z
Solamente archivos comprimidos en adjuntos,
sino utilize los botones superiores para adjuntar link URL, pdf , spoiler o videos de Youtube.
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
Italia1
Posts: 60
Joined: Mon Mar 24, 2014 10:55 am
Location: Italia

Re: Underline and italic in PDF seems not work

Post by Italia1 »

danielmaximiliano wrote:
Italia1 wrote: P.S. I add my PDF but i don't see my attach :shock:
P.S.2. I add my PDF in 7zip
test.7z
Solamente archivos comprimidos en adjuntos,
sino utilize los botones superiores para adjuntar link URL, pdf , spoiler o videos de Youtube.
Thanks for information... sorry :oops:
My PDF is in my PC, not online. So I attach an 7z: it's ok?
Have you an idea how can have underline, bold, italic and strikeout in my PDF with PRINT command in HMG 3.2(Stable)?
Thanks and regards! :)
I use the great HMG3.2(stable). Have i nice international HMG to everyone!
Javier Tovar
Posts: 1275
Joined: Tue Sep 03, 2013 4:22 am
Location: Tecámac, México

Re: Underline and italic in PDF seems not work

Post by Javier Tovar »

Hola Italia 1,

Creo que estas confundido (o yo lo estoy), creo que estas combinando dos formas de Imprimir, una es usando "El sistema de Impresión" y otra es "HMGHPDF", y creo que estas utilizando "HMGHPDF" y ahí no se puede hacer lo que necesitas.
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Hello Italia 1,

I think you are confused (or I am), I think you are combining two forms of Print, one is using "System Printer" and another is "HMGHPDF", and I think these using "HMGHPDF" and there you can not do you need.

Code: Select all

@ Row , Col HPDFPRINT cText ;
 TO ToRow, ToCol ;
 [ FONT cFontName ] ;
 [ SIZE nFontSize ] ;
 [ COLOR aColor ] ;
 [ CENTER|RIGHT ]
Ahí solo esto puedes utilizar.

Documentación esta en HMG.3.2.\hfcl\Samples\HMG_HPDF_DOC.pdf y ejemplo que genera este archivo.

Este ejemplo es una muestra y así si se ejecuta bien.
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////


There only can use this.

Documentation was HMG.3.2. \ HFCL \ Samples \ HMG_HPDF_DOC.pdf and example that generates this file.

This example illustrates well and if executed well.

Code: Select all

#include "hmg.ch"
#include "hfcl.ch"
*#include "hmg_hpdf.ch"  <============================== Aunque la documentación dice que vaya, no va.


FUNCTION MAIN()
	SELECT HPDFDOC "sample.pdf" PAPERLENGTH 300 PAPERWIDTH 300
		START HPDFDOC
			START HPDFPAGE

				@ 105, 10 HPDFPRINT "This is a sample Text in default font."

				@ 120, 10 HPDFPRINT "This is a sample Text in Times-Roman font." SIZE 14

				@ 135, 200 HPDFPRINT "This is right aligned text" SIZE 14 RIGHT

				@ 150, 105 HPDFPRINT "This is center aligned text" COLOR { 255, 0, 0 } CENTER

				@ 170, 105 HPDFPRINT "This is text in bigger font size" SIZE 30 COLOR { 255, 0, 0 } 

				@ 190, 10 HPDFPRINT "The font is Tscparan.TTF" size 12

			END HPDFPAGE
		END HPDFDOC

RETURN NIL
Saludos / Regards
User avatar
danielmaximiliano
Posts: 2607
Joined: Fri Apr 09, 2010 4:53 pm
Location: Argentina
Contact:

Re: Underline and italic in PDF seems not work

Post by danielmaximiliano »

Italia1 wrote: Have you an idea how can have underline, bold, italic and strikeout in my PDF with PRINT command in HMG 3.2 ?
Thanks and regards! :)
Use HMGPDF.

mire en C:\hmg.3.2\hfcl\Doc\HMG_HPDF_Doc.pdf

Source File C:\hmg.3.2\hfcl\Source\HMG_HPDF.Prg

Code: Select all

_HMG_HPDF_PRINT ( nRow, nCol, cFontName, nFontSize, nRColor, nGColor, nBColor, cText, lBold, lItalic, lUnderline, lStrikeout, lColor, lFont, lSize, cAlign )
C:\hmg.3.2\INCLUDE\hfcl_hmg_hpdf.ch

Code: Select all

#xcommand @ <Row> , <Col> HPDFPRINT [ DATA ] <cText> ;
	[ <lfont : FONT> <cFontName> ] ;
	[ <lsize : SIZE> <nFontSize> ] ;
	[ <bold : BOLD> ] ;
	[ <italic : ITALIC> ] ;
	[ <underline : UNDERLINE> ] ;
	[ <strikeout : STRIKEOUT> ] ;
	[ <lcolor : COLOR> <aColor> ] ;
	[ <align:CENTER,RIGHT> ] ;
	=> ;
	_HMG_HPDF_PRINT ( <Row> , <Col> , <cFontName> , <nFontSize> , <aColor>\[1\] , <aColor>\[2\] , <aColor>\[3\] , <cText> , <.bold.> , <.italic.> , <.underline.> , <.strikeout.> , <.lcolor.> , <.lfont.> , <.lsize.> , <"align"> ) 
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
Italia1
Posts: 60
Joined: Mon Mar 24, 2014 10:55 am
Location: Italia

Re: Underline and italic in PDF seems not work

Post by Italia1 »

Thanks for answer.

I use this commands
http://hmgforum.com/hmgdoc/data/printdata.htm
http://hmgforum.com/hmgdoc/data/selectprinter.htm
that i found in HMG Reference (Print System). I'm sure that I'm confused :oops:
What is my mistake?
I like
SELECT PRINTER
START / END PRINTDOC
START / END PRINT PAGE
PRINT, LINE and so on.

It's all ok, but not underline, italic etc.

This is my
hmg_hpdf.7z
My hmg_hpdf.ch
(4.55 KiB) Downloaded 379 times
In this file there is

Code: Select all

#xcommand @ <Row> , <Col> PRINT [ DATA ] <cText> ;
	[ <lfont : FONT> <cFontName> ] ;
	[ <lsize : SIZE> <nFontSize> ] ;
	[ <bold : BOLD> ] ;
	[ <italic : ITALIC> ] ;
	[ <underline : UNDERLINE> ] ;
	[ <strikeout : STRIKEOUT> ] ;
	[ <lcolor : COLOR> <aColor> ] ;
	[ <align:CENTER,RIGHT> ] ;
	=> ;
	_HMG_HPDF_PRINT ( <Row> , <Col> , <cFontName> , <nFontSize> , <aColor>\[1\] , <aColor>\[2\] , <aColor>\[3\] , <cText> , <.bold.> , <.italic.> , <.underline.> , <.strikeout.> , <.lcolor.> , <.lfont.> , <.lsize.> , <"align"> ) 
It's wrong file or reference error?

Sorry for my question if is stupid :oops: :oops:

Thanks to all! :)
Last edited by Italia1 on Tue Apr 08, 2014 8:44 pm, edited 2 times in total.
I use the great HMG3.2(stable). Have i nice international HMG to everyone!
Javier Tovar
Posts: 1275
Joined: Tue Sep 03, 2013 4:22 am
Location: Tecámac, México

Re: Underline and italic in PDF seems not work

Post by Javier Tovar »

Hola DanielMaximiliano,

Si ya lo revise, y no hace nada si pongo:

@ 105, 10 HPDFPRINT "This is a sample Text in default font." UNDERLINE ITALIC

Y no hay modificación alguna del texto.

Alguna idea? Falta algo? esta mal escrito?

Saludos
Post Reply