Generic text-only printer driver doesn't work

时光怂恿深爱的人放手 提交于 2019-12-19 10:33:20

问题


I am using Generic text-only printer driver, provided as a sample in WDK(Windows driver toolkit). But it works with some applications and doesn't work with others. Like it works with Notepad and Microsoft word, but doesn't work with chrome browser or FloreantPOS. I tried using this driver to print to a file or a thermal printer with following 4 applications:-

1)Simple text on Notepad: Works successfully.

2)Text + graphics(word art) on Microsoft Word: Works successfully i.e. prints text and omits graphics

3)Printing simple text from google docs on Chrome browser: Doesn't work i.e. in case of printing to a file, the file is empty and in case of printing to a thermal printer, I get a blank page

4)Printing a receipt from FloreantPOS: Same as (3).

I was wondering if somebody can tell me what chrome and FloreantPOS are doing differently? Also, can I make some changes into Generic text-only driver to make it work with chrome and and FloreantPOS ?

Thanks!!


回答1:


Chrome prints text as graphics, or at least on all the web sites I tried. It uses line drawing to draw the text rather than printing actual characters; therefore, there is nothing for a text-only driver to print. You can demonstrate this by printing to Adobe PDF and then opening the resulting PDF and inspecting it with preflight analysis. I printed 20 pages from a cnn.com web site and got no text in the PDF. When I print to the Windows text-only printer, I get nothing but a bunch of linefeed characters.

Unfortunately, some applications print this way. I get the same results with Firefox. (Browsers are all notoriously bad at printing.) Using Firefox on tumblr.com, which is mostly plain text, I get complete garbage. Most likely, Firefox is printing using glyph IDs rather than characters, which the text-only driver probably doesn't handle correctly.

I'm afraid there is no fix for this other than using a different driver. A plain text driver is very limited and I doubt it will work well with most applications. I would expect even Word to fail with certain fonts. I would recommend using the Unidriver Postscript or raster driver instead.



来源:https://stackoverflow.com/questions/11491655/generic-text-only-printer-driver-doesnt-work

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!