Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

print file with a script

Status
Not open for further replies.

rshandy

Technical User
Dec 26, 2003
91
US
After I've manipulated the data, I am writing the results to text file. Right now I've been manually printing the file.

How can I automatically print the file (using the default printer that the script was accessed from) from within my script.

If it matters, the server is running windows 2000 and the script is accessed from a browser (resides in our intranet directory - we use IIS server)

Thanks
 
Look up Win32::printer, to format prints, it can take a bit of work to format the data though.

Nice module

It should be as simple as copying the file to the printer port, but you won't get any formatting

--Paul


Nancy Griffith - songstress extraordinaire,
and composer of the snipers anthem "From a distance ...
 
Thanks paul.

The printout doesn't have to look super pretty, but will it print it as it looks, for example, in notepad, which doesn't use formatting??
 
I use enscript to print out my text documents...Only thing is that your printer needs to support postscript.
(see
When Postscript is not supported, I use combination of enscript to produce a *.ps file, then ghostscript ( to produce a *.pdf file.

It works well, but does require a bit of time to tweak the settings.

AD AUGUSTA PER ANGUSTA

Thierry
 
$print_ok=`copy myfile.txt LPT1:`;

Should work for regular text files

--Paul

Nancy Griffith - songstress extraordinaire,
and composer of the snipers anthem "From a distance ...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top