Thank you amigo Esgici !!esgici wrote:My opinion is same as Daniel
Thanks amigo Pablo;
please continue to support HMG by helping community
Viva HMG
QHTM in HMG
Moderator: Rathinagiri
- Pablo César
- Posts: 4059
- Joined: Wed Sep 08, 2010 1:18 pm
- Location: Curitiba - Brasil
QHTM in HMG
Last edited by Pablo César on Tue Dec 11, 2012 12:59 pm, edited 1 time in total.
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
- Pablo César
- Posts: 4059
- Joined: Wed Sep 08, 2010 1:18 pm
- Location: Curitiba - Brasil
QHTM in HMG
These problems happen even compiling in UNICODE ? Your source editor it is in UTF-8 format ?mol wrote:I've tested it, but I had problems with national fonts and CSS.
Is it possible to rsolve these problems?
May you show us in captured screen your problem ?
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
Re: QHTM in HMG
I've tested with hmg 3.0.46 without UTF.
I didn't think about it.
I'll install new HMG and I'll test it again.
Source html was coded with UTF-8, really. My fault.
Regards, Marek
I didn't think about it.
I'll install new HMG and I'll test it again.
Source html was coded with UTF-8, really. My fault.
Regards, Marek
- luisvasquezcl
- Posts: 1258
- Joined: Thu Jul 31, 2008 3:23 am
- Location: Chile
- Contact:
Re: QHTM in HMG
Gracias Pablo,
tambien me uno a Daniel y agradezco tu esfuerzo y generosidad.
Saludos cordiales,
Luis Vasquez
tambien me uno a Daniel y agradezco tu esfuerzo y generosidad.
Saludos cordiales,
Luis Vasquez
- Pablo César
- Posts: 4059
- Joined: Wed Sep 08, 2010 1:18 pm
- Location: Curitiba - Brasil
QHTM in HMG
Muchas gracias Luis por el apoyo de todos ustedes.luisvasquezcl wrote:Gracias Pablo,
tambien me uno a Daniel y agradezco tu esfuerzo y generosidad.
Saludos cordiales,
Luis Vasquez
Now Zoom and fonts handling it is possible. Thanks to our friend Claudio Soto. I releasing a new version with provisory printing option, because I am still founding much difficulties to implement QHTM function for printing.
I am with this dificulty in function PrintHTML. I am not getting print functions reconcile the Miniprint with QHTM in HMG.
The QHTM, accurate printing object handle. In MiniGUI hbprn is given by: hbprn:=hbprinter():new() and HMG no longer exists. I tried:
Code: Select all
Static Procedure PrintHTML( cHTMLFile )
Local hContext, nCountPages, Cycle
Local hDC := _HMG_SYSDATA[374] // it is not working with this (It's what I need)
SELECT PRINTER DEFAULT ;
ORIENTATION PRINTER_ORIENT_PORTRAIT ;
PAPERSIZE PRINTER_PAPER_A4 ;
QUALITY PRINTER_RES_MEDIUM ;
PREVIEW
// SELECT PRINTER DIALOG TO lSuccess PREVIEW
hContext := QHTM_PrintCreateContext()
START PRINTDOC
If QHTM_PrintSetTextFile( hContext, cHTMLFile )
nCountPages := QHTM_PrintLayout( hDC, hContext )
For Cycle := 1 to nCountPages
START PRINTPAGE
QHTM_PrintPage( hDC, hContext, Cycle )
END PRINTPAGE
Next
Endif
END PRINTDOC
QHTM_PrintDestroyContext( hContext )
Return Nil
nCountPages := QHTM_PrintLayout( HBPrn : hDC, hContext )
and
QHTM_PrintPage( HBPrn : hDC, hContext, Cycle )
As you can see, hbprinter class return a object hbprn which it can get it handle:
Code: Select all
Static Procedure PrintHTML( cHTMLFile )
Local hContext, nCountPages, Cycle
// Init PrintSys
hbprn:=hbprinter():new()
// Select by dialog
hbprn:selectprinter("",.T.)
// If !Empty( HBPRNERROR )
If !Empty( hbprn:error )
Return nIL
Endif
#define DM_ORIENTATION 0x00000001
#define DMORIENT_PORTRAIT 1
#define DM_PAPERSIZE 0x00000002
#define DMPAPER_A4 9 /* A4 210 x 297 mm */
// Set orientation PORTRAIT
hbprn:setdevmode(DM_ORIENTATION,DMORIENT_PORTRAIT)
// Set PaperSize DMPAPER_A4
hbprn:setdevmode(DM_PAPERSIZE,DMPAPER_A4)
// Set print margins Top 2 Left 5
hbprn:setviewportorg(2,5)
// Set Preview on
hbprn:PreviewMode := .T.
// Set preview rect 0, 0, GetDesktopRealHeight(), GetDesktopRealWidth()
hbprn:previewrect:={0, 0, GetDesktopRealHeight(), GetDesktopRealWidth()}
// Set preview scale 2
hbprn:previewscale:=2
// Set thumbnails on
hbprn:Thumbnails := .T.
hContext := QHTM_PrintCreateContext()
// Start doc name 'Print form'
hbprn:startdoc('Print form')
If QHTM_PrintSetTextFile( hContext, cHTMLFile )
nCountPages := QHTM_PrintLayout( HBPrn : hDC, hContext )
For Cycle := 1 to nCountPages
// Start Page
hbprn:startpage()
QHTM_PrintPage( HBPrn : hDC, hContext, Cycle )
// End Page
If ( _HMG_BeginTabActive , _EndTabPage() , hbprn:endpage() )
Next
Endif
hbprn:enddoc()
QHTM_PrintDestroyContext( hContext )
// Release PrintSys
hbprn:end()
Return Nil
My question is how I can get the object handle in MINIPRINT or how I can replace hbprinter class ? Some colleague could help me, please ?
<Attached file removed, see last message with now release>
Last edited by Pablo César on Tue Dec 18, 2012 12:57 am, edited 1 time in total.
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
- Pablo César
- Posts: 4059
- Joined: Wed Sep 08, 2010 1:18 pm
- Location: Curitiba - Brasil
QHTM in HMG
With this code:
I am close. It has called Preview (two pages and it is in according with my html file) but... in blank...
Code: Select all
Static Procedure PrintHTML( cHTMLFile )
Local hContext, nCountPages, Cycle
SELECT PRINTER DEFAULT ;
ORIENTATION PRINTER_ORIENT_PORTRAIT ;
PAPERSIZE PRINTER_PAPER_A4 ;
QUALITY PRINTER_RES_MEDIUM ;
PREVIEW
// SELECT PRINTER DIALOG TO lSuccess PREVIEW
hDC := _HMG_SYSDATA[374] // it should work (this is what I need)
START PRINTDOC NAME "Print form - QHTM"
hContext := QHTM_PrintCreateContext()
If QHTM_PrintSetTextFile( hContext, cHTMLFile )
nCountPages := QHTM_PrintLayout( hDC, hContext )
For Cycle := 1 to nCountPages
START PRINTPAGE
QHTM_PrintPage( hDC, hContext, Cycle )
END PRINTPAGE
Next
Endif
END PRINTDOC
QHTM_PrintDestroyContext( hContext )
Return Nil
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
- Pablo César
- Posts: 4059
- Joined: Wed Sep 08, 2010 1:18 pm
- Location: Curitiba - Brasil
Re: QHTM in HMG
I found something interesting in this case. If I cut off PREVIEW option, then it will print.
SELECT PRINTER DEFAULT ;
ORIENTATION PRINTER_ORIENT_PORTRAIT ;
PAPERSIZE PRINTER_PAPER_A4 ;
QUALITY PRINTER_RES_MEDIUM
// PREVIEW (take out)
Would it be a bug in our PREVIEW code ?
SELECT PRINTER DEFAULT ;
ORIENTATION PRINTER_ORIENT_PORTRAIT ;
PAPERSIZE PRINTER_PAPER_A4 ;
QUALITY PRINTER_RES_MEDIUM
// PREVIEW (take out)
Would it be a bug in our PREVIEW code ?
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
- Pablo César
- Posts: 4059
- Joined: Wed Sep 08, 2010 1:18 pm
- Location: Curitiba - Brasil
QHTM in HMG
I GOT IT !!!
Now Preview it is working with QHTM !! Nothing wrong with our MINIPRINT ! It was a second handle needed.
I also got to change backcolor thru html commands. Also changed font color of QHTM_MessageBox (It is like our MsgInfo).
<Attached file removed, see last message with now release>
Now Preview it is working with QHTM !! Nothing wrong with our MINIPRINT ! It was a second handle needed.
I also got to change backcolor thru html commands. Also changed font color of QHTM_MessageBox (It is like our MsgInfo).
<Attached file removed, see last message with now release>
Last edited by Pablo César on Tue Dec 18, 2012 9:07 pm, edited 1 time in total.
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
- Rathinagiri
- Posts: 5471
- Joined: Tue Jul 29, 2008 6:30 pm
- DBs Used: MariaDB, SQLite, SQLCipher and MySQL
- Location: Sivakasi, India
- Contact:
Re: QHTM in HMG
Super Pablo.
So, that means we can format our report in html also and print in the printer. That is so cool.
I have two points to be cleared:
1. Whether html code from a variable can be printed without saving it to a html file.
2. Can we use tables and other alignment formats?
So, that means we can format our report in html also and print in the printer. That is so cool.
I have two points to be cleared:
1. Whether html code from a variable can be printed without saving it to a html file.
2. Can we use tables and other alignment formats?
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
South or North HMG is worth.
...the possibilities are endless.
- Pablo César
- Posts: 4059
- Joined: Wed Sep 08, 2010 1:18 pm
- Location: Curitiba - Brasil
QHTM in HMG
Yeahh !!rathinagiri wrote:Super Pablo.
So, that means we can format our report in html also and print in the printer. That is so cool.
Yes, we can print by HTML file and by context passed by variable (type character). I put more one button to show both cases.1. Whether html code from a variable can be printed without saving it to a html file.
Yes we can use tables and other formats. See Tags.doc file in package attached file.2. Can we use tables and other alignment formats?
Thank you Mr. Rathinagiri to show your entusiastic interest for it ! See QHtm\Res\HTML\qhtm.html file for more QHTM Controls.
Remarks: My first message was re-edited for better understanding.
- Attachments
-
- QHtm.rar
- (1.02 MiB) Downloaded 1000 times
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein