문제

I'm new to c#, so I hope this doesn't sound/look stupid.

I'm having an issue while printing. I can't seem to get my form to print on the full size of a regular piece of paper. It's printing in landscape, the height fits, but my width goes off the page. Here is the code I'm working with.

Any help would be greatly appreciated, thanks!

private void printDocument1_PrintPage(object sender, PrintPageEventArgs e)
{
    e.Graphics.DrawImage(memoryImage, 0, 0);
}

private void printPreviewDialog1_Load(object sender, EventArgs e)
{
    PrintPreviewDialog _PrintPreview = new PrintPreviewDialog();
    _PrintPreview.Document = printDocument1;
    ((Form)_PrintPreview).WindowState = FormWindowState.Normal;
    _PrintPreview.ShowDialog();
}

private void printToolStripMenuItem_Click(object sender, EventArgs e)
{
    SaveAsBitmap(this, @"img\1.bmp");
    CaptureScreen();
    printDocument1.PrinterSettings.DefaultPageSettings.Landscape = true;
    printDocument1.Print();
}

올바른 솔루션이 없습니다

다른 팁

try setting the papersize in the printOption : http://msdn.microsoft.com/en-us/library/aa691030(v=vs.71).aspx

Hope this can help you!

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