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!

Printing to a Printer

Status
Not open for further replies.

theguru97321

IS-IT--Management
Feb 3, 2003
216
US
I have a web app that i wrote with perl/cgi/mysql. I have cron jobs that run a script twice a month. I want the results to print to a printer that is setup as a queue on the linux server.

How do I format that?
 
Is this a linux or perl question ?
what's the question? format what?

Regards
--Paul

cigless ...
 
This is in the PERL forum..so it's a PERL Question.

how do I format a ...

OPEN (printer)
Print $all_this_stuff to printer
CLOSE (Printer)

script?

 
Code:
system ("print $file");
Code:
system ("lp $file");

or you could be more specific
--Paul

cigless ...
 
I would like to specify the printer.
it's called HP_4500n

I thought the system prompt was for Windows machines?
This is running on a Linux System.
 
system afaik, shells out to the host os
Try that and let us know how you get on

whqtever command the cron job uses to print should be OK, just rememebr paths (absolute vs relative)

HTH

cigless ...
 
Ok, i have it printing now. How do I force the HTML formating to print properly, I'm getting <Table> <font> info, and I want it to print with proper formating.
 
I haven't come across this before, but I'm sure you're going to have to render the document before printing it.

Have a look for GhostScript, this seems to be an ideal application, though I'm not sure if it can run as a console app

HTH
--Paul

cigless ...
 
Is there a way to tell the printer what type of document it is before it prints it? like a header?
 
I'm not sure, you could try the linux forum, or the hardware forum for that.

If you send a postscript job to the printer, does that print as text as well?

--Paul

cigless ...
 
I hadn't looked at GhostScript in a while, I think you'll need a HTML to PDF converter (if such exists, i checked there's a few), and use Ghostscript to render the postscript for the webpage, and push the .ps file to the printer.

I'm still unsure as to whether this can all be done in the console

--Paul

cigless ...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top