如何提取本地打印机打印的文字?
时间:2011-12-21
来源:互联网
操作系统为Windows XP
需要在本地打印机打印文字的时候提取它打印的文字。目前想到的方案有:
1)使用虚拟打印机,让虚拟打印机打印txt文件,完成后再将打印任务转移(Redirect)到本地打印机。
使用这个方案,不知道有没有免费的SDK可供使用?
2)监控打印机端口
据我监控的结果看起来像是乱码,应该是并口发送给打印机的指令集,不知道如何从这些指令集中提取打印文字?
另外其它简单可行的方法也希望大家提供。
需要在本地打印机打印文字的时候提取它打印的文字。目前想到的方案有:
1)使用虚拟打印机,让虚拟打印机打印txt文件,完成后再将打印任务转移(Redirect)到本地打印机。
使用这个方案,不知道有没有免费的SDK可供使用?
2)监控打印机端口
据我监控的结果看起来像是乱码,应该是并口发送给打印机的指令集,不知道如何从这些指令集中提取打印文字?
另外其它简单可行的方法也希望大家提供。
作者: silverbullet007 发布时间: 2011-12-21
如果往打印机送的是字符的像素或图片,你能保证正确识别出对应啥文字吗?
作者: zhao4zhong1 发布时间: 2011-12-21
引用 1 楼 zhao4zhong1 的回复:
如果往打印机送的是字符的像素或图片,你能保证正确识别出对应啥文字吗?
如果往打印机送的是字符的像素或图片,你能保证正确识别出对应啥文字吗?
首先可以肯定打印的是文字,不是图片,因为使用虚拟打印机后输出的是文字
作者: silverbullet007 发布时间: 2011-12-21
不知道可不可以从打印缓冲池中提取文字?
作者: silverbullet007 发布时间: 2011-12-21
没有人帮忙解决吗?
作者: silverbullet007 发布时间: 2011-12-22
Windows下Hook打印文字相关API?
Printer: Printing Sample
Click to open or copy the files for the Printer sample.
The Printer sample shows how to print using both the CreateDC and the PrinterDlg methods for acquiring a printer HDC. The user is allowed to print different graphical objects, as well as a complete device font set. An "Abort" dialog box is also implemented.
The Printer sample also does the following:
Provides complete device capabilities for all printers and the display.
Provides information (levels 1 and 2) returned by a call to EnumPrinters.
Shows how to enumerate fonts for a particular DC.
Illustrates differences among the various mapping modes.
Demonstrates GDI features.
Building SDK Samples
This sample uses the following keywords:
createdc; deletedc; errmsgbox; getlasterror; getstringres; getstringres2; isdbcsleadbyte; mainwndproc; makeintresource; my_mbslen; outnum; outstr; outstr2; outstr3; printdlg; printthread; registerclass; strcat; winmain; wsprintf
Printer: Printing Sample
Click to open or copy the files for the Printer sample.
The Printer sample shows how to print using both the CreateDC and the PrinterDlg methods for acquiring a printer HDC. The user is allowed to print different graphical objects, as well as a complete device font set. An "Abort" dialog box is also implemented.
The Printer sample also does the following:
Provides complete device capabilities for all printers and the display.
Provides information (levels 1 and 2) returned by a call to EnumPrinters.
Shows how to enumerate fonts for a particular DC.
Illustrates differences among the various mapping modes.
Demonstrates GDI features.
Building SDK Samples
This sample uses the following keywords:
createdc; deletedc; errmsgbox; getlasterror; getstringres; getstringres2; isdbcsleadbyte; mainwndproc; makeintresource; my_mbslen; outnum; outstr; outstr2; outstr3; printdlg; printthread; registerclass; strcat; winmain; wsprintf
作者: zhao4zhong1 发布时间: 2011-12-22
相关阅读 更多
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28