how do i print a php generated document to a printer from another php script?

i have a php script that can generate a pdf file and would like a php script that is able to send the pdf directly to a printer connected to the computer running the script.

the script can be ran on either a machine with redhat linux or windows 2k.

    I had this problem...Only solution I could find was to redirect the browser to a new window which displays the contents to print, perform an javascript function to print on body load, and set a javascript redirect back to whatever page you want (make sure you give the redirect enough delay to allow the page to load fully).

    If you need the Javascript to do this try searching goolge for

    JAVASCRIPT PRINT

    and

    JAVASCRIPT REDIRECT

      i don't want to print from the browser. i want the server itself to initiate the print job on one of the printers connected to the server itself

        it may be possible to make a call to cups or lpr

        maybe something like this...

        exec("lpr pdf2ps `php generate_pdf.php`",$results);
        

        this might work in linux, but how would i do this in windows? it seems we might want the windows server to initiate the print job because we will have more control over the printers connected to it.

          Write a Reply...