English 中文(简体)
与世界森林基金会印刷图像并分配打印机Name
原标题:Printing visual with WPF and assigning printerName

我正试图在我的世界森林论坛申请中印刷这一页。 由于《印刷品》方法的方便,我已决定把它作为“信道”。

尽管我可以动态地确定打印机名称,但使用印刷对话箱并非一种选择,工作人员必须能够点击印刷塔顿,并自动打印到其配制的打印机上(通过阅读,而不是根据视窗打印机,通过书写)。 这有可能使用印刷页面活动操作器(印刷文件的一部分,例如pd.PrintPage +=新的印刷PageEventHandler(pageLayoutForPrint))

印本

  1. 打印机 如果我使用印刷方法,就应确定姓名?

  2. 如果无法确定打印机Name,那么印刷我血管的最佳方式是什么? 印刷理论是有效的制图坐标,然后转至打印机。 EG,用一个文本箱印制一份文件,我们可以使用以下假冒代码:

    int left = textbox.Left;
    int top = textbox.Top;
    e.Graphics.DrawString(Textbox.Text, printFont, Brushes.Black, left, top, new StringFormat());

最佳回答
问题回答

利用印刷版。 您不必展示印刷方言。

你可以很容易地用这一简单的法典来做到这一点。 我遗憾地说,你的问题重复了。

private void Button_Click(object sender, RoutedEventArgs e)
{
    PrintDialog _PrintDialog = new PrintDialog();

    _PrintDialog.PrintQueue = new PrintQueue(new PrintServer(), "Printer Name");

    _PrintDialog.PrintVisual(CanvasOrAnyVisualName, "Printing Job Name");
}




相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...