Welcome Guest, Not a member yet? Register   Sign In
Print file on server
#6

(07-21-2024, 02:36 AM)pippuccio76 Wrote:
(07-19-2024, 08:33 PM)InsiteFX Wrote: Could you imagine someone taking over and just dumping to your printer?

All I can fine is this, and a addon printer web access.

Print to Zebra printer in php

i print label on zebra printer with my webapp ,this is the code : 

Code:
class StampaEtichette{

private $print_data;

    public $error='';

    public function __construct($print_data)
    {
    $this->print_data = $print_data;

    }


    public function zpl()  {

        $ip_stampante =getenv('IP_STAMPANTE');
       
        $fp = @pfsockopen($ip_stampante, 6101 ,$errno, $errstr);
       
        if(!$fp){
           
            $errore =  "$errstr ($errno)<br/>\n";

            log_message('error', 'Errore apertura socket : '.$errore);

            return $errore;
           
        }else{
           
            if(fputs($fp, $this->print_data)){
               
                fclose($fp);

                return 'stampato';
           
            }else{
           
                return 'Problemi Fput';
           
            }

           
           
        }
       
           


    }






}
 

but zpl is as text file , how can i send to printer pdf or xlsx ?

You need to somehow convert those types to a format understood by printers. Those are much more complex than the CSV format which has PHP functions.
Reply


Messages In This Thread
Print file on server - by pippuccio76 - 07-18-2024, 04:16 AM
RE: Print file on server - by InsiteFX - 07-18-2024, 09:23 PM
RE: Print file on server - by pippuccio76 - 07-19-2024, 12:19 PM
RE: Print file on server - by InsiteFX - 07-19-2024, 08:33 PM
RE: Print file on server - by pippuccio76 - 07-21-2024, 02:36 AM
RE: Print file on server - by Bosborne - 07-21-2024, 03:34 AM



Theme © iAndrew 2016 - Forum software by © MyBB