Closed c-scholz-acribit closed 6 years ago
Okay I came to the conclusion that actually some provided values were wrong or I called them wrongly. Here's what I found out or need help with @smalot
$printer->getAttributes();
:
"orientation-requested-supported" => [ 0=>"portrait", 1=>"landscape", 2=>"reverse-landscape", 3=>"reverse-portrait"]
and I tried all combinations: " $job->addAttribute('orientation-requested', 'landscape');
, $job->addAttribute('orientation-requested', 1)
, $job->addAttribute('orientation-requested', 1)
also with value 4 (like it's stated in the CUPS documentation for command line printing) and the setAttribute()-method, yet the request keeps returning a 400 HTTP error
edit: after checking the other issues here, I found the solution provided - we need to change the provided value to a 4 Byte value with pack('N', $val)
lpoptions -d [printername]
? like "Collate", "ColorModel", "PageSize", "InputSource" etc.
edit: I checked IPP implementation and chose to use "sheet-collate" & "multiple-document-handling", "print-color-mode", "media" and "media-source" for the aforementioned optionsDuplicate of https://github.com/smalot/cups-ipp/issues/2
It might also be worth a note, that there is no straight way to print "all" pages of a document. setPageRanges()
cannot be ommitted,so we have to specify a range. One solution is to use something like `setPageRanges('1-99')' - just set the max range value to a high value that you hopefully will never exceed.
I am using the library inside a Laravel 5.6 application.
When I try to print a document I get an exception (HTTP-Statuscode 400 - "Bad Request").
Check a screenshot of the Exception here: https://www2.pic-upload.de/img/35784064/Bildschirmfotovom2018-08-1316-47-35.png
Any ideas what I could try? The provided data in the $printjob Object is correct, too, because I fixed any errors with this by now. Also I added www-data user (Apache) to lp usergroup in Ubuntu.
I am just wondering how I'd maybe get around this 400 error and finally print a pdf...