printing - problem with margins

  • Thread starter Thread starter ool
  • Start date Start date
O

ool

Hello,

How can I get physical margins of printer??


When I do it in this way :
public void pd_PrintPage(object sender, PrintPageEventArgs ev)
{
...
iLeftMargin = ev.MarginBounds.X ; // is always 100 = 1inch
iPageWidth = ev.MarginBounds.Width // is always 2 inches smaler than
ev.PageBounds.Width
}


I would like get the same values which I get using GetDeviceCaps(hdc,
PHYSICALOFFSETY); in Visual C++


Thomas
 
Thomas,
You will have to PInvoke on GetDeviceCaps in a call to print a document.
Just do the same calculations as before wrapped in the PInvoked method and
change the result to 1/100ths of an inch.

Ron Allen
 
Back
Top