C# Printing Offset -


i'm trying print a5 pages c# application i'm getting unexpected results. output vertically offset 110mm output starts halfway down page , offset horizontally 20mm. output starts off left hand side of page (so it's hard measure exact offset). output clipped horizontally , vertically.

for example,

dc.drawrectangle (0, 0, 100, 100) 

draws box halfway down page , half box missing due being off left hand edge. size seems ok though.

i must missing obvious can't quite see myself. know might causing these offsets?

this may provide hint:

// rectangle describes page minus margins. rect rectpage = new rect(marginpage.left, marginpage.top,   dlg.printableareawidth - (marginpage.left + marginpage.right),                         dlg.printableareaheight - (marginpage.top + marginpage.bottom)); // draw rectangle reflect user's margins. dc.drawrectangle(null, pn, rectpage); 

from : charles petzold's apps = code markup


Comments