phpprintipp
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Phpprintipp] Print PDF


From: Thomas Harding
Subject: Re: [Phpprintipp] Print PDF
Date: Wed, 05 Jun 2013 20:17:13 +0200
User-agent: Mozilla/5.0 (X11; Linux i686; rv:10.0.12) Gecko/20130116 Icedove/10.0.12

Hi! / Bonjour,

Me too :)

Note : PrintURI *must pass a string to the print server*, and *that
string must be an URI*, /never a filename/.

*If and only if* "file" is located on the print server, use "file://"
scheme (yes, two slashes: the third one is root :).

See: http://www.nongnu.org/phpprintipp/usage#c7

=====

Note: if file is accessible by php interpreter (web server...) and not
by the print server, use PrintJob.

PrintJob *is* the general behavior

See: http://www.nongnu.org/phpprintipp/usage#c1

To print a string is the fallback in case of file cannot be found and
furthermore read.

You should check if file is readable *by the php interpreter* before to
print it (and use PrintJob).

But if your print server allows PrintURI /and/ you want to use that
function, you /must check/ *on the print server side* if file pointed by
the given uri is readable, eg by http, ftp, or file (NFS mounts, ...)

(see your print server documentation).

Please fill a bug on php::print::ipp project page if:
 * file is readable *by the print server*
 * /and PrintURI does not work as expected/.

The web server/php interpreter will not stream the file to the print
server in case of PrintURI, as streaming a file/feed a string (something
like an HTTP POST) is the job of the PrintJob operation.

In short, use PrintJob if file is located on web server. And to avoid
the behavior you describe with PrintJob too, simply open file first,
close it, then print in case of success or display/raise an error on failure

Best regards,
TSFH


Le 05/06/2013 14:24, Stanislas Latron a écrit :
> Hi, first, I'm sorry about this english, I'm french :)
>
> I would like to print a pdf by you PrintIPP.php. I do the following
> source - code :
>
> <?php
>     require('PrintIPP.php');
>     if (!function_exists('_')) require_once ('gettext.php');
>    
>     function  AutoPrintToPrinter($envoi,$lieuBon){
>         $ipp = new PrintIPP();
>         if($lieuBon == 6){
>             $ipp->setHost("192.168.20.76");
>             $ipp->setPrinterURI("imp technique fauquet");
>         }else{
>             $ipp->setHost("192.168.30.49");
>             $ipp->setPrinterURI("LP-techniques");
>         }
>        
> $ipp->printURI("../Historique_des_bons_de_travaux/Bon-".$envoi.".pdf");
>         //$ipp->printJob();
>     }
>    
>    
>     $envoi = $_GET['num'];
>     $lieuBon = $_GET['lieu'];
>     AutoPrintToPrinter($envoi, $lieuBon);
> ?>
>
> But I can't print my .pdf, I only have on my paper
> "../Historique_des_bons_de_travaux/Bon-5498.pdf".
>
> Can you help me ?
>
> Best regards,
>
> -- 
> Stanislas Latron
> 25 Rue Pierre Curie
> 76330 Notre Dame de Gravenchon
>
>
> _______________________________________________
> Phpprintipp mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/phpprintipp




reply via email to

[Prev in Thread] Current Thread [Next in Thread]