printing on the right side of paper

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: G.Esmeijer (gerrit_at_nomail.nl)
Date: 07/28/04


Date: Wed, 28 Jul 2004 22:33:32 +0200

Friends,

I'm (a bit) dissapointed about the printing possibilities in c#. It could
also be lack of knowedge.

I would like to align a text on the right side of the paper when printing.

For example
tekst = DateTime.Today.Date.ToString("dd-MM-yyyy");
// asign content to the variable tekst
SizeF stringSize= ev.Graphics.MeasureString(tekst, printFont);
// measure the length of the tekst ... in what??
xPos = (float) ev.MarginBounds.Right - stringSize;
// to aligh it on thr right side of the paper
ev.Graphics.DrawString (tekst, printFont, Brushes.Black, xPos, yPos, new
StringFormat());

I would like to print tekst now but I have problems with the typing.

I tried all kinds of things but there must be some easy way of doing this.
Who can help me with this..

and who knows a bunch of nice printing functions. I dont like the way C#
handles the printer control.

regards
Gerrit Esmeijer



Relevant Pages

  • Re: |GG| Photo Print App for Multiple Images w/ Borders?
    ... align several different sized digital images within one 8.5 x 11 paper ... complete with my choice of borders surrounding them. ... printing on my color printer. ...
    (rec.photo.digital)
  • Re: Right align when printing
    ... > What's best practice to right align numbers when printing.?? ... >> Is there an easy way to align decimal values to keep decimal placeholder ... Dim s As Single ... ' Splits the number at the first dot and prints ...
    (microsoft.public.vb.general.discussion)
  • Re: Photo Print App for Multiple Images w/ Borders?
    ... align several different sized digital images within one 8.5 x 11 paper ... complete with my choice of borders surrounding them. ... printing on my color printer. ...
    (rec.photo.digital)
  • Right align when printing
    ... What's best practice to right align numbers when printing.?? ... string before printing? ... Is there an easy way to align decimal values to keep decimal placeholder ... aligned even if there are different numbers of decimals ?? ...
    (microsoft.public.vb.general.discussion)