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

hi i have a view with 4 button to download 4 files . Is it possible to send file to printer (or open prompt to print) with the files ?
Reply
#2

I found this article.

How to Print Document in PHP and JavaScript
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#3

(This post was last modified: 07-19-2024, 12:27 PM by pippuccio76.)

(07-18-2024, 09:23 PM)InsiteFX Wrote: I found this article.

How to Print Document in PHP and JavaScript

no , this symply  print page with js native function windows.print() ,  not file ...

i  must send the 4 files to the printer
Reply
#4

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
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#5

(This post was last modified: 07-21-2024, 02:37 AM by pippuccio76.)

(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 ?
Reply
#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




Theme © iAndrew 2016 - Forum software by © MyBB