richard terry ha scritto:
> 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.
>   
You must consider two things. First, PagePosition and Leftmargin depend 
on the printer resolution (which you can query from the printer 
properties); "500" means something to one printer, and something else to 
another. Second, a combination of printer/printer driver can work 
differently from another one. You could try to draw some line, with 
different starting points, to see what happens and deduce margins and 
behaviours.

The best I did about this, was to have parameters for scaling and 
offsets. This way you setup your print in a straightforward manner, and 
then you can adapt your page to any printer by varying few parameters 
and a few tries.

Regards,
Doriano


------------------------------------------------------------------------------
Stay on top of everything new and different, both inside and 
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today. 
Use priority code J9JMT32. http://p.sf.net/sfu/p
_______________________________________________
Gambas-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gambas-user

Reply via email to