>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.pcland 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.