0

I maintain a PowerBuilder Classic 12.5 application which has functionality to print checks on a Source Technologies MICR printer. The application has been running fine in a Windows XP environment. We are trying to move to a Windows-7 operating system and the check printing no longer works.

Here is the issue. PowerBuilder issues a PrintOpen followed by several Print commands to send command strings to the printer to unlock MICR mode and various secure fonts:

il_job = PrintOpen( )  
Print(il_job,'&%STF[password]$')  
Print(il_job,'&%SMCPFFFF$')    
Print(il_job,'&%STP10003$')    
Print(il_job,'&%STP10002$')    
Print(il_job,'&%STP10001$')    
Print(il_job,'&%1B$&u600D')    
Print(il_job,'&%1B$*t600R')   

This works fine on XP, and if you redirect the printer to "print to file", you can see the command strings right there in the file.

In Windows-7, the printer does not recognize the command strings, and in fact, just prints the commands on the check stock. If you do the same "print to file", you can see the commands in there, but each character in the command string is separated by other characters.

The following is a sample taken from the "print to" file, and you can see the string '&%SMCPFFFF$' by looking at each character that precedes an asterisk (*).

*p171Y&*p50X%*p100XS*p150XM*p200XC*p250XP*p300XF*p350XF*p400XF*p450XF*p500X$   

This would seem to be a print driver issue, and in fact, Source Technologies now provides a "Universal Print Driver" which we have been told to use. Our PC support person was able to get the check printing working temporarily by re-installing the old print driver that we used on Windows XP, but as soon as the printer is turned off and on again, it resets to the new universal driver.

I tried using PrintDefineFont and PrintSetFont, to set the font to Courier Regular 8pt (which is what the Tech Support guy at Source Technologies told us we needed), but that didn't help:

PrintDefineFont(il_job, 1, "Courier", -8, 400, Fixed!, AnyFont!, FALSE, FALSE)  
PrintSetFont(il_job, 1)   

Can anyone help me with this issue? Or suggest where I might get help.
Thanks.

4

3 回答 3

0

试试这个:添加一个新的打印机。选择您的打印机所连接的端口。选择制造商:通用,打印机:通用/仅文本。当您打印到这台打印机时,它应该将您的Print语句中的内容准确地发送到打印机。

于 2014-04-30T16:14:47.563 回答
0

谢谢休,我试过你的建议,听起来不错,但不幸的是没有效果。
碰巧的是,截至昨天,我确实解决了最后一个打印问题。我必须单独处理每种特殊字体(微线、签名、支票金额等),并结合使用 PrintDefineFont/PrintSetFont、嵌入式打印机命令字符串来重置字体,并将数据窗口中的列控件更改为一个文本控件(打印机命令字符串和数据一样被移到该字段中,一个有效,另一个无效)。
感谢你的帮助。
莱斯

于 2014-05-02T17:24:04.573 回答
0

请右键单击您的软件并进入兼容模式并在其中选择“Windows XP with SP3”,单击“应用”和“确定”。

确认软件现在是否完美发送打印命令?

于 2019-07-24T06:27:38.493 回答