在C#中创建虚拟打印机 [英] Creating virtual printer in C#

查看:1115
本文介绍了在C#中创建虚拟打印机的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在c#& amp;中创建虚拟打印机创建的打印机应该在打印文件时显示在打印机设置选项卡的下拉列表中。

这是可能的c#或.net,如果可能请帮助我



提前致谢..



我的尝试:



能够创建打印机应用程序,但在打印文件时它没有显示在打印机对话框中

I would like to create virtual printer in c# & the created printer should be shows in drop down of printer setting tab while printing the file.
Is that possible in c# or .net, if possible please help me on that

Thanks in advance..

What I have tried:

Able to create printer application, but its not showing in Printer dialog while printing a file

推荐答案

可能吗?是的。



实用吗?天啊!



您正在寻找编写打印机驱动程序。尽管可以在C#中执行此操作,但为了使其正常工作,您将在代码运行时将.NET Framework的重量加载到内核中。这不是一件明智的事情。



您还将在C#中重写相当大量的Windows Driver Kit代码。这不是我想要解决的事情,我已经编写了40年的代码。



像这样的驱动程序最好用C / C ++编写,而不是C# 。



您可以找到Windows驱动程序工具包文档和示例这里 [ ^ ]。
Possible? Yes.

Practical? Hell no!

You're looking at writing a printer driver. Though this is possible to do in C#, in order for it to work, you'd be loading the weight of the .NET Framework into the kernel when the code is running. That's not a wise thing to do.

You'd also be rewriting quite a sizable chunk of the Windows Driver Kit code in C#. This is not an undertaking I would want to tackle and I've been writing code for 40 years.

Drivers like this are best written in C/C++, not C#.

You can find the Windows Driver Kit documentation and samples here[^].


这篇关于在C#中创建虚拟打印机的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆