Page 4 of 4
Re: HMG Print Samples
Posted: Sat Jan 04, 2020 6:38 pm
by ROBROS
Hi esgici,
so far I never felt in need to print data via dbase, clipper etc. I always opened data with excel and made them fit for printing. Or I transferred data to other people who were able to output them fitting their needs. Now I am helping a 2 people company to make their day a bit easier. They can use programs (excel is used to create forms, but not with filling these forms with data), so I decided to try it with hmg. The job is to fill forms with data. Thank you so much for your print samples, it brought me confidence, I can do that with hmg.
Your samples are very useful for me.
Thank you
Robert
Re: HMG Print Samples
Posted: Tue Feb 04, 2020 3:12 pm
by ROBROS
Hi, Ihave a question:
Does printsystem work with windows 10? I mean is the default printer recognized? I can't try, because I use win 7 in VirtualBox.
Thx
Robert
Re: HMG Print Samples
Posted: Wed Feb 05, 2020 9:51 am
by dragancesu
No worries, recognizes all printers as well as pdf printers (print to pdf)
Re: HMG Print Samples
Posted: Wed Feb 05, 2020 12:26 pm
by ROBROS
Thx, Dragan, I was hoping this.
Robert
Re: HMG Print Samples
Posted: Sun Feb 09, 2020 2:43 pm
by Templar
Printing certainly is one of the hardest things, and can i ask for some help, please?
The samples are very useful, but I am struggling with trying to right-justify text. Any tips on this?
I've used <RightMargin> - LEN( TextString ) + nCharWidth
but it still isn't quite right.
Yemplar
Re: HMG Print Samples
Posted: Sun Feb 09, 2020 5:52 pm
by dragancesu
Try demo, prtest01.prg
Code: Select all
#include <hmg.ch>
*-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.
/*
HMG Print ( Mini Print ) for beginners in 10 easy steps
Step #1 :
Use everything with default values,
write only "This is a test"
to four corners and center of paper.
*/
PROCEDURE PrintTest()
/*
Default paper size is A4 Sheet; 210- by 297-millimeters
*/
LOCAL lSuccess := .F.,;
cTestString := "This is a test",;
nMostRightCol := 210,; // Default page size is A4 : 210 x 297 mm
nMostBottmRow := 297
SELECT PRINTER DEFAULT TO lSuccess PREVIEW
IF lSuccess
START PRINTDOC
START PRINTPAGE
@ 0, 0 PRINT cTestString // Top Left
@ 0, nMostRightCol PRINT cTestString RIGHT // Top Right
@ nMostBottmRow / 2, nMostRightCol / 2 PRINT cTestString CENTER // Center of paper
@ nMostBottmRow - 4, 0 PRINT cTestString // Bottom Left
@ nMostBottmRow - 4, nMostRightCol PRINT cTestString RIGHT // Bottom Right
END PRINTPAGE
END PRINTDOC
ELSE
MsgStop( "Couldn't select default printer !", "ERROR !" )
ENDIF
RETURN // PrintTest()
*-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.
dimensions are in mm, just adjust where to print and add RIGHT or CENTER, LEFT is defaults
FONT and SIZE are some of the windows fonts