[Gambas-user] Setting top margin of printer.

richard terry rterry at ...1946...
Mon Apr 20 07:24:11 CEST 2009


I'm still struggling with the printer stuff.

Say I have an A4 Page, and I want to write something right near the top of the 
page

If I do:

Dim PagePosition as integer
Dim LeftMargin as integer = 100
Dim FontHeight as integer

'calculate the font height
 fontHeight = Draw.TextHeight("Check the font height")

'start the page position
 PagePostition = 500
 Draw.Text("Some writing", leftMargin, pagePosition)
PagePosition += fontHeight
Draw.Text("Some  more writing", leftMargin, pagePosition)

 bla bla

Draw.end

then the text appears at about a 1.5cm margin from the top.printed as two 
lines of text

But I need to get it right up to the top for this application as it is 
printing on a pre-formatted printed form.

so I set this to 

PagePostition = 250

and do the same thing, the top row of text does not appear on the form (ie the 
printer must consider it outside of the margins.


There seems no way to set the margins on the kde popup dialog box for an a4 
sheet.

Any help/idea's appreciated.

Regards

Richard




More information about the User mailing list