Otra consulta, como se puede tener en una misma página un texto con font por ejemplo en Helvetica y a la vez
otro texto en Helvita pero en Bold ( en negrita ).
No se como hacerlo. Alguien tiene algun ejemplo por favor.
Gracias,
Winca
PDFClass como poner letras en Bold ( negrita )
Moderador: Moderadores
- JoséQuintas
- Administrador

- Mensagens: 20267
- Registrado em: 26 Fev 2007 11:59
- Localização: São Paulo-SP
PDFClass como poner letras en Bold ( negrita )
Trata-se de outro fonte.
Se está se referindo a classe, é usar o cFontName equivalente ao negrito.
Exemplo: "Courier", "Courier Bold"
Mas confirme os nomes, pra saber qual o nome correto a ser usado.
Se está se referindo a classe, é usar o cFontName equivalente ao negrito.
Exemplo: "Courier", "Courier Bold"
Mas confirme os nomes, pra saber qual o nome correto a ser usado.
Código: Selecionar todos
METHOD DrawText( nTop, nLeft, xValue, cPicture, nFontSize, cFontName, nAngle, anRGB ) CLASS PDFClass
José M. C. Quintas
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"
https://github.com/JoseQuintas/
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"
https://github.com/JoseQuintas/
- JoséQuintas
- Administrador

- Mensagens: 20267
- Registrado em: 26 Fev 2007 11:59
- Localização: São Paulo-SP
PDFClass como poner letras en Bold ( negrita )
José M. C. Quintas
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"
https://github.com/JoseQuintas/
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"
https://github.com/JoseQuintas/
PDFClass como poner letras en Bold ( negrita )
Don Jose, gracias por responder.
Si me referia a usar font del tipo:
Ejemplo: "Courier" y "Courier Bold"
Como puedo cambiar de un tipo de font a otro, dentro de la misma clase.
Para poder destacar algunos textos dentro de la pagina.
Winca
Si me referia a usar font del tipo:
Ejemplo: "Courier" y "Courier Bold"
Como puedo cambiar de un tipo de font a otro, dentro de la misma clase.
Para poder destacar algunos textos dentro de la pagina.
Winca
- JoséQuintas
- Administrador

- Mensagens: 20267
- Registrado em: 26 Fev 2007 11:59
- Localização: São Paulo-SP
PDFClass como poner letras en Bold ( negrita )
Só olhar o método DrawText(), que tem a informação que precisa, além de já aceitar passar como parâmetro.
Código: Selecionar todos
METHOD DrawText( nTop, nLeft, xValue, cPicture, nFontSize, cFontName, nAngle, anRGB ) CLASS PDFClass
LOCAL nRadian , cTexto
hb_Default( @nFontSize, ::nFontSize )
hb_Default( @cFontName, ::cFontName )
hb_Default( @cPicture, "" )
hb_Default( @nAngle, ::nAngle )
cTexto := Transform( xValue, cPicture )
::nCol := nLeft + Len( cTexto )
IF ::nPrinterType > 2
@ nTop, nLeft SAY cTexto
ELSE
nTop := ::RowToPDFRow( nTop )
nLeft := ::ColToPDFCol( nLeft )
HPDF_Page_SetFontAndSize( ::oPage, HPDF_GetFont( ::oPdf, cFontName, ::cCodePage ), nFontSize )
IF anRGB != NIL
HPDF_Page_SetRGBFill( ::oPage, anRGB[ 1 ], anRGB[ 2 ], anRGB[ 3 ] )
HPDF_Page_SetRGBStroke( ::oPage, anRGB[ 1 ], anRGB[ 2], anRGB[ 3] )
ENDIF
HPDF_Page_BeginText( ::oPage )
nRadian := ( nAngle / 180 ) * 3.141592
HPDF_Page_SetTextMatrix( ::oPage, Cos( nRadian ), Sin( nRadian ), -Sin( nRadian ), Cos( nRadian ), nLeft, nTop )
HPDF_Page_ShowText( ::oPage, cTexto )
HPDF_Page_EndText( ::oPage )
IF anRGB != NIL
HPDF_Page_SetRGBFill( ::Page, 0, 0, 0 )
HPDF_Page_SetRGBStroke( ::Page, 0, 0, 0 )
ENDIF
ENDIF
RETURN NIL
Código: Selecionar todos
DrawText( 5, 5, Date(), , 10, "courier" )
DrawText( 10, 10, Date(), , 15, "courier bold" )
José M. C. Quintas
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"
https://github.com/JoseQuintas/
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"
https://github.com/JoseQuintas/
