+1
HMG_HPDF - Export to PDF made easy...
Moderator: Rathinagiri
- esgici
- Posts: 4543
- Joined: Wed Jul 30, 2008 9:17 pm
- DBs Used: DBF
- Location: iskenderun / Turkiye
- Contact:
Re: HMG_HPDF - Export to PDF made easy...
Viva INTERNATIONAL HMG
Re: HMG_HPDF - Export to PDF made easy...
+1Rathinagiri wrote: ↑Tue Mar 13, 2018 1:50 pm Wonderful!
EDward, Can you make it work for unicode encoding also? Especially Indian languages?
BPD
Convert Dream into Reality through HMG
Convert Dream into Reality through HMG
Re: HMG_HPDF - Export to PDF made easy...
Hi, Rathi.Rathinagiri wrote: ↑Tue Mar 13, 2018 1:50 pm EDward, Can you make it work for unicode encoding also? Especially Indian languages?
I made a PDF natively encoded in UTF-8 (without generating Unicode text as a png file).
Is the example shown at the top of the PDF page in the Indian alphabet?
Would this solution meet your expectations?
In the utf-8 editor, characters from this font look different than in the resulting PDF. I pasted the characters with the Windows Character Map.
The other fonts appear in the editor in the same way as in PDF.
What I noticed, the built-in PDF fonts (Courier, Helvetica, Times-Roman) can not be used for Unicode encoding. Use TTF fonts.
Circular text printing requires changes for Unicode encoding support. Replace the HPDF_CircleText function with the one in the attachment.
Regards, Edward.
- Attachments
-
- DemoUTF.7z
- (109.29 KiB) Downloaded 275 times
Last edited by edk on Thu Mar 15, 2018 11:46 am, edited 1 time in total.
Re: HMG_HPDF - Export to PDF made easy...
Fantastic
Then you Edward, Today I am out of station, will check the next day
Then you Edward, Today I am out of station, will check the next day
BPD
Convert Dream into Reality through HMG
Convert Dream into Reality through HMG
- esgici
- Posts: 4543
- Joined: Wed Jul 30, 2008 9:17 pm
- DBs Used: DBF
- Location: iskenderun / Turkiye
- Contact:
Re: HMG_HPDF - Export to PDF made easy...
Hi friends
Does anyone know who is author of Harbur (not HMG) HaruPDF wrapper ?
I remember he was PritPal Bedi, but sadly I can't found in Harbour docs
Or more useful, if possible any doc (at least ReadMe) about Harbur HPDF
TIA
Does anyone know who is author of Harbur (not HMG) HaruPDF wrapper ?
I remember he was PritPal Bedi, but sadly I can't found in Harbour docs
Or more useful, if possible any doc (at least ReadMe) about Harbur HPDF
TIA
Viva INTERNATIONAL HMG
Re: HMG_HPDF - Export to PDF made easy...
Hi Esgici,
You can found the following description in the Harbour changelog also:/*----------------------------------------------------------------------*
* *
* HaruLib (x)Harbour Wrappers *
* . *
* http://www.libharu.org/ *
* http://sourceforge.net/projects/libharu/ *
* *
* Pritpal Bedi <pritpal@hotmail.com> *
* *
*----------------------------------------------------------------------*/
2008-05-18 09:21 UTC+0100 Viktor Szakats (harbour syenar.net)
* contrib/hbhpdf/harupdf.c
! Fixed all MSVC warnings. Now builds cleanly.
2008-05-18 08:52 UTC+0100 Viktor Szakats (harbour syenar.net)
+ contrib/hbhpdf/Makefile
+ contrib/hbhpdf/make_b32.bat
+ contrib/hbhpdf/make_vc.bat
+ contrib/hbhpdf/make_gcc.sh
+ contrib/hbhpdf/common.mak
+ contrib/hbhpdf/tests/bld_b32.bat
+ contrib/hbhpdf/tests/bld_vc.bat
+ Added build/make files.
; Please test GNU make files.
* contrib/make_b32_all.bat
* contrib/make_gcc_all.sh
* contrib/make_vc_all.bat
+ Added hbhpdf to 'all' make files.
(not yet to GNU make files though)
- contrib/hbhpdf/tests/<data files>
+ contrib/hbhpdf/tests/files/<data files>
* Data files needed for test app moved
to a subdir.
* contrib/hbhpdf/tests/harupdf.prg
! Absolute paths changed to relative ones
(for both input and output ones).
! NumToHex() -> hb_NumToHex()
+ hbct added to lib list because test program
uses SIN()/COS()/TAN() from it.
- contrib/hbhpdf/tests/harupdf.ch
+ contrib/hbhpdf/harupdf.ch
* Moved to main dir.
- contrib/hbhpdf/hpdf.h
- Removed original libharu header. This
will be picked up from the package dir,
along with the rest of the .h files.
* contrib/hbhpdf/harupdf.ch
+ Added self-guard.
* contrib/hbhpdf/harupdf.c
! Fixed a few BCC warnings. It now builds cleanly.
; NOTE: There are a lot MSVC casting warnings and errors left.
; Many thanks for this contrib to Pritpal Bedi.
2008-05-17 18:45 UTC+0800 Pritpal Bedi (pritpal@vouchcac.com)
+ harbour/contrib/hbhpdf
+ harbour/contrib/hbhpdf/harupdf.c
+ harbour/contrib/hbhpdf/hpdf.h
Initial upload of wrappers for HaruPDF Library (http://sourceforge.net/projects/libharu/).
+ harbour/contrib/hbhpdf/tests
+ harbour/contrib/hbhpdf/tests/harupdf.prg
+ harbour/contrib/hbhpdf/tests/harupdf.ch
Test program.
Kind Regards,
Grigory Filatov
"Everything should be made as simple as possible, but no simpler." Albert Einstein
Grigory Filatov
"Everything should be made as simple as possible, but no simpler." Albert Einstein
- esgici
- Posts: 4543
- Joined: Wed Jul 30, 2008 9:17 pm
- DBs Used: DBF
- Location: iskenderun / Turkiye
- Contact:
Re: HMG_HPDF - Export to PDF made easy...
Thank you very much Grigory
Viva Harbour, viva HMG
Viva INTERNATIONAL HMG
Re: HMG_HPDF - Export to PDF made easy...
Tested and nearly 100% success, big thanks for your hard work for natively encoded pdf in UTF-8
Some of the characters do not shows properly is a second thing and not mistake of yours
BPD
Convert Dream into Reality through HMG
Convert Dream into Reality through HMG
Re: HMG_HPDF - Export to PDF made easy...
Hi Marek.mol wrote: ↑Sun Mar 04, 2018 7:29 am There is Windows function EnumFontFamiliesEx which enumerates installed fonts with its options.
But, I can't find if there is a font filename for font name.
HMG sources contains call to older version of the function EnumFontFamilies (this one is for compatibility wit 16-bit versions).
c_controlmisc.c file contains definition of EnumFonts.
EnumFontFamilies returns LogFont structure:It is desciped on https://msdn.microsoft.com/pl-pl/librar ... s.85).aspx pageCode: Select all
typedef struct tagLOGFONT { LONG lfHeight; LONG lfWidth; LONG lfEscapement; LONG lfOrientation; LONG lfWeight; BYTE lfItalic; BYTE lfUnderline; BYTE lfStrikeOut; BYTE lfCharSet; BYTE lfOutPrecision; BYTE lfClipPrecision; BYTE lfQuality; BYTE lfPitchAndFamily; TCHAR lfFaceName[LF_FACESIZE]; } LOGFONT, *PLOGFONT;
Some fonts have only English names, some of them can have English and native (Polish, Chinese ) names too.
I think Claudio Soto should know sth. about it. (His name is places as comment in sources )
Recently, I had a similar need for the user to choose their own fonts to create a PDF file.
As you know, the HaruPDF library uses native Helvetica, Courier and Times-Roman fonts. You can also use fonts from .ttf files but you can not use the fonts enumerated in the system.
My solution is to examine the available font .ttf files in the system folder, the current folder and the user specified for HaruPDF support and create an array with a .ttf file list.
Based on the received array with a .ttf file list, I created a dialog to select the font.
At the end I made a function where after entering the fontface name, attributes: bold and/or italics, the appropriate .ttf file is found.
This is not a perfect solution and therefore I do not integrate it with h_HMG_HPDF.Prg, but maybe it will be a bit helpful.
I used undocumented GDI32 function GetFontResourceInfo to retrieve the font names from a .ttf file.
It does not work correctly with every .ttf file. My knowledge of C (and English) is so-so, that's why I could do something incorrectly .
Maybe someone knows better solution how to retrieve a Fontname from TTF.
Best regards, Edward.
Re: HMG_HPDF - Export to PDF made easy...
Minor bug fix in the dialog: error occurred when user enter the name of the font not included in the font list.