Centering vertical line of printed page

Machaira

Well-known member
Joined
Aug 19, 2002
Messages
325
Location
Abingdon, MD
Something I thought would be simple has turned out to be a little more difficult than I thought. I simply want to print a vertical line in the middle of a landscaped sheet of paper. Even hardcoding the x value doesnt seem to work when the margins change:

gr.DrawLine(Pens.Black, 550, top + (lineHeight * m_CurLine), 550, e.MarginBounds.Bottom - (lineHeight * 2))

Changing the hardcoded value to:

e.PageBounds.Width / 2

doesnt seem to work either.

It seems the x value is relative to the left margin for some reason. Is this correct? If so, why would it be?
 
theres always unprintable area on one printer. The unprintable area is Margin total on the left and right, and Margin total on the top and bottom. But you cant assume that the unprintable area on your printer is Margin/2 on the left and right, and Margin/2 on the top and bottom.
And it seems no way to reveal how the unprintable area is distributed along the edges of the page.

Is this help?
 
I know theres an unprintable area on a printer. What I cant understand is even using the PageBounds width / 2 doesnt print in the middle of the page. I could understand if I tried to print along the edge of the PageBounds that it would print, but why doesnt it print in the middle? Why have a PageBounds property if referencing members of it doesnt do what it should do? :confused:
 
Back
Top