通过C访问PrinterDriver中的特殊数据(如双面打印)

时间:2022-09-30 20:02:25

moin-moin,

I know, I am the only living person, still writing software for OS/2, but maybe someone can give me a hint:

我知道,我是唯一一个仍在为OS / 2编写软件的人,但也许有人可以给我一个提示:

For a customer I need to print a lot of different Reports on many pre-printed papers, some one-side, some double-sided, orientation landscaped or portrait (so, there are many different combinations)

对于客户,我需要在许多预先打印的纸张上打印许多不同的报告,一些单面,一些双面,定向景观或肖像(因此,有许多不同的组合)

the option i use now is to assign every possible report to its own printer-driver and let the user set the apropriate settings once for those drivers.

我现在使用的选项是将每个可能的报告分配给它自己的打印机驱动程序,并让用户为这些驱动程序设置一次适当的设置。

what i need is a more generic way. I want the user just to provide the driver, and I myself want to set Orientation and Sideness (and even the paper feed) programatically.

我需要的是一种更通用的方式。我希望用户只是提供驱动程序,我自己想要以编程方式设置Orientation和Sideness(甚至是paper feed)。

Any suggestions if this is possible? And how?

如有可能,有什么建议吗?如何?

Thanks, Peter

2 个解决方案

#1


okay, just to close this and give a solution for anyone beaten with the same problem.

好吧,只是为了关闭这个并为任何被打同样问题的人提供解决方案。

i installed pmpdfwriter, installed a postscript printer driver associated with this output device and replaced the gsos2.exe (which is called by the printersystem) with a small selfwritten program, that analyses the filename. If there are my special "parameters" in the name, i copy the generated PostScript file (from the printer driver) to a network device, alongside with a small shell script "lpr -P printer -other options for duplex and orientation and paper feed" which i get from a database and a small selfwritten "printer configuration application", else i call the original gsos2.exe. On the network side there is a unix server, that looks for the scripts and calls those scripts ("on UNIX all is text, on OS/2 most is binary"). With this technique, i have the option to print stacks of different reports on different papers (if they are fed in the same printer) together without mixing them with other print requests.

我安装了pmpdfwriter,安装了与此输出设备关联的postscript打印机驱动程序,并用一个小的自写程序替换了gsos2.exe(由打印机系统调用),该程序分析文件名。如果名称中有我的特殊“参数”,我将生成的PostScript文件(从打印机驱动程序)复制到网络设备,以及一个小的shell脚本“lpr -P printer - 其他选项,用于双面打印和方向和纸张输入“我从数据库和一个小的自写”打印机配置应用程序“获得,否则我称之为原始gsos2.exe。在网络方面,有一个unix服务器,它查找脚本并调用这些脚本(“在UNIX上,所有文本都是文本,在OS / 2上最多是二进制文件”)。使用这种技术,我可以选择在不同的纸张上打印不同报告的堆栈(如果它们在同一台打印机中送入),而不会将它们与其他打印请求混合在一起。

#2


Though it's been 17 years since I was an OS/2 developer, I recall that around 1.3 - 2.0 the printing API operated in a similar manner to Win3.1/WinNT 3.51.

虽然我是OS / 2开发人员已经17年了,但我记得大约1.3 - 2.0的打印API以类似于Win3.1 / WinNT 3.51的方式运行。

Your question has kindled a quest for me to hunt through SO for unanswered OS/2 questions, brb !

你的问题点燃了我寻求通过SO寻找未回答的OS / 2问题,brb!

#1


okay, just to close this and give a solution for anyone beaten with the same problem.

好吧,只是为了关闭这个并为任何被打同样问题的人提供解决方案。

i installed pmpdfwriter, installed a postscript printer driver associated with this output device and replaced the gsos2.exe (which is called by the printersystem) with a small selfwritten program, that analyses the filename. If there are my special "parameters" in the name, i copy the generated PostScript file (from the printer driver) to a network device, alongside with a small shell script "lpr -P printer -other options for duplex and orientation and paper feed" which i get from a database and a small selfwritten "printer configuration application", else i call the original gsos2.exe. On the network side there is a unix server, that looks for the scripts and calls those scripts ("on UNIX all is text, on OS/2 most is binary"). With this technique, i have the option to print stacks of different reports on different papers (if they are fed in the same printer) together without mixing them with other print requests.

我安装了pmpdfwriter,安装了与此输出设备关联的postscript打印机驱动程序,并用一个小的自写程序替换了gsos2.exe(由打印机系统调用),该程序分析文件名。如果名称中有我的特殊“参数”,我将生成的PostScript文件(从打印机驱动程序)复制到网络设备,以及一个小的shell脚本“lpr -P printer - 其他选项,用于双面打印和方向和纸张输入“我从数据库和一个小的自写”打印机配置应用程序“获得,否则我称之为原始gsos2.exe。在网络方面,有一个unix服务器,它查找脚本并调用这些脚本(“在UNIX上,所有文本都是文本,在OS / 2上最多是二进制文件”)。使用这种技术,我可以选择在不同的纸张上打印不同报告的堆栈(如果它们在同一台打印机中送入),而不会将它们与其他打印请求混合在一起。

#2


Though it's been 17 years since I was an OS/2 developer, I recall that around 1.3 - 2.0 the printing API operated in a similar manner to Win3.1/WinNT 3.51.

虽然我是OS / 2开发人员已经17年了,但我记得大约1.3 - 2.0的打印API以类似于Win3.1 / WinNT 3.51的方式运行。

Your question has kindled a quest for me to hunt through SO for unanswered OS/2 questions, brb !

你的问题点燃了我寻求通过SO寻找未回答的OS / 2问题,brb!