Dynamically change print data

假如想象 提交于 2019-12-06 11:14:18

if you mean to manipulate each page, ie this page landscape next page portrait, etc then i would work on the postscript input, and not even think about the specific hardware communications.

On the other hand you want to grab the print head and manipulate things real time after printing has started then the approach will obviously depend on the specific printer.

I would try to do this at a higher level if possible. Best would be if you take control of how the postscript is being generated, then you can insert <<...>> setpagedevice to change printer parameters.

One problem is that most printer manufacturers have stopped distributing documentation on the printer command language.

Another problems is ghostscript output devices are hopelessly out of date, like dot matrix printers. (see problem one).

For a screen printing output application, I reverse engineered the epson 1400 print command language and wrote a program to output a bitmap to the printer. Then I wrote a ghostscript printdriver based on a .bmp driver which created bitmaps and converted the bitmap to epson commands. Since you want to use an HP, this code unfortunately won't help.

Having gone down that road, I can tell you it isn't easy. Inkjet's don't allow rotation, so you'd need to rasterize the inkjet, then re-create a rotated image. Ghostscript is itself tricky to get running to a printer using gsprint and redmon, but if you already have postscript job that prints upright, then the image can be rotated and shifted with postscript commands.

I don't understand what you are trying to accomplish. Can you use a pc with a webcam to preview the orientation, then generate a bitmap and print it to the printer or do you need to wait till the paper is in position before generating the print data?

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