Encontré el bug. Substituye la funcion
Code: Select all
Function _HMG_HPDF_MULTILINE_PRINT ( nRow, nCol, nToRow, nToCol, cFontName, nFontSize, nRColor, nGColor, nBColor, cText, lBold, lItalic, lUnderline, lStrikeout, lColor, lFont, lSize, cAlign )
Local nWidth := _HMG_SYSDATA[ 150 ][ 4 ]
Local nHeight := _HMG_SYSDATA[ 150 ][ 5 ]
Local nTextWidth := 0
Local nxPos := _HMG_HPDF_MM2Pixel( nCol )
Local nyPos := nHeight - _HMG_HPDF_MM2Pixel( nRow )
Local nToxPos := nxPos + _HMG_HPDF_MM2Pixel( nToCol - nCol )
Local nToyPos := nyPos - _HMG_HPDF_MM2Pixel( nToRow - nRow )
Local oFont := Nil
Local cFont := ''
Local cTtfFnt // Pablo June, 2014
default cFontName := ''
default nFontSize := 12
default nRColor := 0
default nGColor := 0
default nBColor := 0
default lBold := .f.
default lItalic := .f.
default lUnderline := .f.
default lStrikeout := .f.
default lColor := .f.
default lFont := .f.
default lSize := .f.
default cAlign := ''
cTtfFnt := cFontName // Pablo June, 2014
If _HMG_SYSDATA[ 150 ][ 1 ] == Nil // PDF object not found!
_HMG_HPDF_Error( 3 )
Return Nil
endif
If _HMG_SYSDATA[ 150 ][ 7 ] == Nil // PDF Page object not found!
_HMG_HPDF_Error( 5 )
Return Nil
endif
// set color
If lColor
HPDF_Page_SetRGBFill( _HMG_SYSDATA[ 150 ][ 7 ], nRColor/255, nGColor/255, nBColor/255 )
else
HPDF_Page_SetRGBFill( _HMG_SYSDATA[ 150 ][ 7 ], 0.0, 0.0, 0.0 )
endIf
// set font
If HMG_LEN( alltrim( cFontName ) ) == 0
cFontName := _HMG_HPDF_SetFont( cFontName, lBold, lItalic )
oFont := HPDF_GetFont( _HMG_SYSDATA[ 150 ][ 1 ], cFontName, _HMG_SYSDATA[ 150 ][ 10 ] )
else
// cFontName := alltrim( cFontName )
cFontName := AllTrim(_HMG_HPDF_SetFont( cFontName, lBold, lItalic ))
If HMG_UPPER( HB_USUBSTR( cFontName, HMG_LEN( cFontName ) - 3 ) ) == '.TTF' //Pablo. June 2014
cFont := HPDF_LOADTTFONTFROMFILE( _HMG_SYSDATA[ 150 ][ 1 ], cFontName, .t. )
If HMG_LEN( alltrim( cFont ) ) == 0
_HMG_HPDF_Error( 6 , cFontName )
Return Nil
endif
oFont := HPDF_GetFont( _HMG_SYSDATA[ 150 ][ 1 ], cFont, _HMG_SYSDATA[ 150 ][ 10 ] )
else
If HMG_UPPER( alltrim( cFontName ) ) == "SYMBOL" .or. HMG_UPPER( alltrim( cFontName ) ) == "ZAPFDINGBATS"
oFont := HPDF_GetFont( _HMG_SYSDATA[ 150 ][ 1 ], cFontName, Nil )
else
oFont := HPDF_GetFont( _HMG_SYSDATA[ 150 ][ 1 ], cFontName, _HMG_SYSDATA[ 150 ][ 10 ] )
endIf
endif
endIf
If oFont == Nil
_HMG_HPDF_Error( 6 , cFontName )
Return Nil
else
HPDF_Page_SetFontAndSize( _HMG_SYSDATA[ 150 ][ 7 ], oFont, nFontSize )
HPDF_Page_BeginText( _HMG_SYSDATA[ 150 ][ 7 ] )
do case
case HMG_UPPER( cAlign ) == 'CENTER'
HPDF_Page_TextRect( _HMG_SYSDATA[ 150 ][ 7 ], nxPos, nyPos, nToxPos, nToyPos, cText, HPDF_TALIGN_CENTER, Nil )
case HMG_UPPER( cAlign ) == 'RIGHT'
HPDF_Page_TextRect( _HMG_SYSDATA[ 150 ][ 7 ], nxPos, nyPos, nToxPos, nToyPos, cText, HPDF_TALIGN_RIGHT, Nil )
case HMG_UPPER( cAlign ) == 'JUSTIFY'
HPDF_Page_TextRect( _HMG_SYSDATA[ 150 ][ 7 ], nxPos, nyPos, nToxPos, nToyPos, cText, HPDF_TALIGN_JUSTIFY, Nil )
otherwise
HPDF_Page_TextRect( _HMG_SYSDATA[ 150 ][ 7 ], nxPos, nyPos, nToxPos, nToyPos, cText, HPDF_TALIGN_LEFT, Nil )
endcase
HPDF_Page_EndText( _HMG_SYSDATA[ 150 ][ 7 ] )
If lDoLog // Pablo June, 2014
HTML_TABLE_LINE(nFHandle,{{StrZero(nRow,4,0)+" ("+StrZero(nyPos,7,2)+")","#FFFFFF",.t.},;
{StrZero(nCol,4,0)+" ("+StrZero(nxPos,7,2)+")","#FFFFFF",.t.},;
{StrZero(_HMG_SYSDATA[ 150 ][ 13 ],3,0),"#FFFFFF",.t.},;
{PadR(If(Empty(cTtfFnt),"<Default>",cTtfFnt),If(HMG_Len(cTtfFnt)>30,HMG_Len(cTtfFnt),30)),"#FFFFFF",.f.},;
{StrZero(nFontSize,2,0),"#FFFFFF",.t.},;
{If(lBold,"BOLD" ,Space(4))+If(lItalic," ITALIC",Space(7)),"#FFFFFF",.f.},;
{cFontName,If(If(Empty(cTtfFnt),HMG_Len(cFontName),HMG_Len(cTtfFnt))==HMG_Len(cFontName),"#FFFFFF","#FFFF66"),.f.}})
Endif
endif
Return Nil
Gracias Eduardo por tu reporte del error. Solo asi podemos construir un buena biblioteca de HMG.
por favor ? Yo ya dí una opinion y una posible solucion, pero Rathi todavia no respondió adecuadamente a este tema y ya se pasaron 2 PATCHs... y todavia nada...
please ? I already gave a review and a possible solution, but still not received adequately answered from Rathi this issue and already took 2 PATCHs... and still nothing...