Hi all !
I also have found dificulties to generate pdf thru HARUPDF and I have exaustly study it source fonts for HMG_HARUPDF and I saw the main problem is to VALIDATE the names of fonts regarding:
- Correct name, this must be according Haru array and when is put the pathfile name
- It's properties, when is ITALIC and BOLD
- Localization when is passed path, name and extension.
And all of these points it all works together. So I decided to review the function
_HMG_HPDF_SetFont which now is making the right validation and more options was added like as:
_HMG_HPDF_SeekHaruFonts(cFntName,lBold,lItalic)
_HMG_HPDF_SeekEquivalences(cFntName,lBold,lItalic)
_HMG_HPDF_ExistInLocal(cFntName)
_HMG_HPDF_SeekInLocalOptions(cFntName,lBold,lItalic)
FWriteLine( nHandle, cString )
And LOG option to create a text file with all fonts involved in the pdf creation and its reassigned fonts names. This gives to the programmer, the chance to see what font is not passed correctly as parameter in _HMG_HPDF_PRINT.
Some times we pass wrongly name of font. With NO path when we want to load from TTF file unless than this file is in current folder.
Some times we pass wrongly with wrong name. So, there is a _HMG_HPDF_SeekInLocalOptions function which takes the 4 first characters and seek in current folder and in Windows folder, then is reassigned name.
I have added cFilePath to work with cFileNoExt in _HMG_HPDF_SeekInLocalOptions function in order to take the correct pathfile name.
But HARUPDF which is the library, it has a limitation regarding: STRIKEOUT and UNDERLINE properties. In our code, we have both itens, but is not working because HARUPDF works with
TTF (True Type Fonts) and this with its limitations.
HARU PDF
Drawing a line for UNDERLINE and STRIKEOUT (suggestion in SourceForge forum)