Send the output to printer

Discussion in 'PHP' started by zeenatnaheed, Sep 15, 2009.

  1. #1
    I am executing the following code

    <?php
    $fhandle = fopen("openingpage.php","rb");
    $contents = fread($fhandle, filesize("openingpage.php"));
    fclose($fhandle);
    $output = eval("?>".$contents);
    $handle = printer_open("Microsoft Office Document Image Writer");
    printer_set_option($handle,PRINTER_MODE,"RAW");
    printer_write($handle,$output);
    printer_close($handle);
    ?>

    No error is displayed but the output does not go the said printer instead output is displayed as a web page

    Any Help?
     
    zeenatnaheed, Sep 15, 2009 IP
  2. premiumscripts

    premiumscripts Peon

    Messages:
    1,062
    Likes Received:
    48
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Printer functions are on the server end, not the client end. Not sure if you know this. Also, they are only supported on windows.
     
    premiumscripts, Sep 15, 2009 IP