Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Printer Codes
Message
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Miscellaneous
Thread ID:
00234801
Message ID:
00234863
Views:
27
>I am porting an application from dBase 3 to VFP 5.0a (still leaving the code as is for now). There are several programs that print reports by setting the DEVICE TO PRINTER and issuing @...SAYs to print the report.
>
>Some of the reports need to be condensed. Some of the programs that print those reports try to set the printer to 17cpi by issuing a CHR(15) command before printing. On a Dot-Matrix, this works fine, but the client is now using an HP8000 printer which has trouble accepting these codes. Instead of changing the pitch, the printer prints garbage characters where the CHR(15) calls take place.
>
>I have tried setting the printer to RAW MODE, but all that does is print a blank page prior to the job. If the printer is set to 17cpi manually AND there are print code within the program, then the report will print at 17cpi. But, some reports mix pitch (meaning that the header is 10cpi and the data is at 17cpi). If the printer is set to 10cpi manually, then it will only print at 10cpi and not accept any print codes.
>

The problem is that the dBASE III code doesn't go through the Windows drivers at all; it's using direct printer commands, and the printer commands for an HP laser printer are not in any way the same as the printer commands used by an Epson-compatible dot matrix printer. You can rework the report to embed HP-specific printer codes equivalent to the Epson print codes and completely bypass the Windows print driver, or better, redo the report using the Report Writer and it's font capability, which work with the Windows printer driver and give you some relief from the variations in printer control codes.

>Can someone please tell me how to set any printer (HP) to condensed mode programatically. If not, please lead me in the right direction that I may find a solution short of re-writing the report.
>

As I recall, the generic code for 17cpi printing for an HP in PCL mode is
CHR(27) + "(s17H"; CHR(27) + "(s10H" returns it to 10CPI. HP used to be very good about providing a programmer's manual with their printers; it might be in the on-line help for recent printers on the HP pritner CD.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Reply
Map
View

Click here to load this message in the networking platform