Closed solosimpi closed 4 years ago
I guess you can pass web url to the sendPrintToPrinter() and it should fetch the file but i have not tested that yet. If that doesn't work then you have to download file and save to disk.
Sorry, for my english, but can You help me, what i should to do if i want to print "URL"? I'm newbie in PHP, I want to print from "URL" without downloading and saving.
$resarray = $gcp->sendPrintToPrinter($printerid, "Printing Doc using Google Cloud Printing", "www.google.com/landing/cloudprint/testpage.pdf", "url"); it does not work
See this in php documentation about fopen
If PHP has decided that filename specifies a registered protocol, and that protocol is registered as a network URL, PHP will check to make sure that allow_url_fopen is enabled. If it is switched off, PHP will emit a warning and the fopen call will fail.
Can you try replacing $handle = fopen($filepath, "rb"); with $handle = fopen($filepath, "r"); in GoogleCloudPrint.php
i think it will be helpful, so in GoogleCloudPrint.php
$post_fields = array(
'printerid' => $printerid,
'title' => $printjobtitle,
'ticket' => "{\"version\": \"1.0\",\"print\": {}}",
'content' => $filepath,
'contentType' => "url"
);
Where $filepath it's URL like www.example/text.txt, however it was sent to jobs
Hello sry for my ver bad english. Your class is awesome, only a question It´s posible to print from a pdf that´s accesible from web, for example: www.mydomain.com/pdf-to-print.pdf ??