문제

I need to print a label to fit the page. I'm tryng this but print big than page, width and height seems to be to much

private void PrinterPrintPage(object sender, PrintPageEventArgs e)
{
    var b = Tasks.Pop();

    if (b.Label == null) 
        b.Label = GetLabelImage(b.Codice, b.ColoreID);

    var rect = e.PageBounds;
    e.Graphics.DrawImage(b.Label, rect);
    e.HasMorePages = Tasks.ContainTasks();

    _printedCount++;
}
도움이 되었습니까?

해결책

As per MSDNs documentation on PrintPageEventArgs.PageBounds,

Most printers cannot print at the very edge of the page.

...first of all, try changing PageBounds to MarginBounds. If this doesn't help, "deflate" the bounds rectangle towards the centre of the page so you move away from the edges.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top