Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Printing To A Disk File
Message
From
14/08/2000 18:20:13
 
 
To
14/08/2000 15:32:30
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00404664
Message ID:
00404751
Views:
12
>Hi All
>
>I am looking for a nice generic way of directing output to a disk file under program control. So, if I want to capture a file full of PCL, I print through an HP Printer Driver, specify a temporary file name, and after the print job has executed, pick up the output file, and processes it further with some special post-driver printing effects.
>

Define a Windows printer mapped to some port (-not- FILE:) that uses the HP LaserJet Series II on the target system with a standard name. You can then SET PRINTER TO whatever the HPLJ Windows printer name is to make certain that the PCL driver is engaged. Now:

REPORT FORM blah TO FILE woof.pcl

and SET PRINTER TO when finished. The file woof.pcl will contain PCL-formatted output. You can do whatever you like with woof.pcl - I assume you're doing something like prepending or postpending a macro or something; take the final result of the file manipulation and squirt it out the port or UNC that has the HP-compatible printer on it using CopyFile() as per the entry on this in the FAQ.

Key issues:

(1) The HP-compatible driver has to be installed to a known name on the system. While you don't have to use the LJ Series II driver, it's about as generic PCL as it comes, and is rock-stable.

(2) VFP has to have had it's current default printer set to the LJ-compatible printer so that the PCL driver is engaged.

(3) Strip any printer references from the .FRX to ensure that the current default printer driver which you've so carefully assigned is engaged.

(4) Use CopyFile() to queue up the output to a port or UNC - you don't want to re-engage the GDI print layer.
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
Next
Reply
Map
View

Click here to load this message in the networking platform