如何在打印,解析和编辑数据之前捕获打印机数据然后将其发送到打印机?任何c#样本都会很棒 [英] how capture printer data before print ,parsing and edit the data then send it to printer?any c#sample would be great

查看:216
本文介绍了如何在打印,解析和编辑数据之前捕获打印机数据然后将其发送到打印机?任何c#样本都会很棒的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好;

我正在寻找在打印前获取打印机数据的源代码或样本(捕获打印机输出)将其放入变量并更改某些值然后以表格形式打印。 />
任何想法如何获取数据并将其放入变量以用于特殊目的。

hi everyone;
i'm looking for source code or sample that get printer data before print (capture printer output) put it in variable and change some values then print it in form.
any idea how to get data and put it into variable for special purpose.

推荐答案

嗯,你将不得不自己编写然后是记事本。



拦截打印作业并进行编辑是一种非常复杂的方法,可以完成邮件合并。



应用程序描述页面图像对打印驱动程序的影响。驱动程序获取该图像并将其转换为打印机理解的代码。



您必须编写一个打印机驱动程序,该驱动程序需要配置才能将作业发送到另一个打印机驱动我从来没有见过。



另外,你不会用C#编写打印机驱动程序。 C / C ++是一个更好的选择,因为你不会在托管代码中重写Windows DDK的大部分内容。



你不会找到和示例这是因为你描述的问题太过分了。





这只不过是字段替换或Word中的邮件合并。这是您在业务应用程序中写入的内容,而不是打印机驱动程序。
Well, you're going to have to write your own Notepad then.

"Intercepting" the print job and editing it is an extraordinarily complex way to do what amounts to Mail Merge.

The application describes what the page image looks like to the print driver. The driver takes that "image" and translates it into code that the printer understands.

You would have to write a printer driver that takes a configuration to send a job to another printer driver. I've never seen one.

Also, you're not going to write a printer driver in C#. C/C++ is a much better choice because you won't be rewriting large parts of the Windows DDK in managed code.

You're not going to find and example of this because it's so overkill for the problem you describe.


This is nothing more than field replacement, or Mail Merge in Word. This is something you write into a line of business application, not a printer driver.


这篇关于如何在打印,解析和编辑数据之前捕获打印机数据然后将其发送到打印机?任何c#样本都会很棒的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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