GM-Script-Writer-62850 / PHP-Scanner-Server

Allows you to use your Linux install as a web based scanner server thus allowing you to scan with any web enabled device; Now supports server side printing! (As of 1.4.11)
59 stars 17 forks source link

Integrated Printer #43

Closed kneiser closed 6 years ago

kneiser commented 6 years ago

I have a printer setup in CUPS on my server, printing from server is working. I have the Integrated Printer option in the config.ini set to "1". PHP-Scanner-Server can detect the printer. When I attempt to print a scanned document a browser (Firefox) window opens and shows the printers defined on my Linux client computer rather than the printer defined in my LAMP server.

What am I doing wrong?

GM-Script-Writer-62850 commented 6 years ago

When you click print you should get this question:

When you click Cancel you should get this (This is what it sounds like you want):

however if you click OK this is what you should get (this sounds like what you are getting):

How are you answering the prompt?

kneiser commented 6 years ago

Ok now i see where I got confused. Part of my problem was where I was trying to get things to work. I now see that the indiviual scanned items have a printer button. I get the behaviour you referenced above.

On the scanned files page, in the bulk operations section, the printer button behaves differently. When selecting all scanned files, the printer button does not allow one to use the server defined printer? It wants to print via the client computer printer dialogue. Is there any way of changing it to the same behaviour as the individual scanned item printer button?

GM-Script-Writer-62850 commented 6 years ago

I am not sure if i should label that as a bug or enhancement

kneiser commented 6 years ago

I am not sure either. As a user I have an expectation that the printer button functionality would be the same for individual scans and bulk operation scans. When using the bulk operations printer button; a user would be selecting more than one scanned image, push the bulk operations print button, expecting to choose a user client workstation or server defined printer. Currently when doing the bulk operations print; a print preview window appears, followed by a browser printer dialogue showing the users' workstation printer list. In my use case; the server printer is CUPS-PDF (I have a cloud service running on my server), The CUPS-PDF directory is accessible by the cloud service, I scan in muliple document pages - later I would need to do a bulk print of all images to a PDF file, move the resulting PDF to somewhere else in the cloud service without having to download a PDF file from the scanner server and not upload it to the cloud service.

I guess another way of doing the same use case would be to have another button in the toolbars connected the the existing Scanner Server PDF function that could provide a "Copy/Move PDF to folder" function? Or introduce new functionality in the the existing PDF functionality? The existing Scanner Server PDF function does a good job of downloading scanned image PDFs to a user workstation but unfortunately does not provide a local server function. Having a function like this would eliminate the need for the CUPS/CUPS-PDF print services.

BTW: I have "somewhat" integrated the "Scanner Server" in to the cloud service so it looks like one of the cloud applications, it looks really good!

GM-Script-Writer-62850 commented 6 years ago

Can you try a patch to see if everything works Change this line: https://github.com/GM-Script-Writer-62850/PHP-Scanner-Server/blob/master/index.php#L138 to: 'bulk'=>"PDF_popup(filesLst,true)"

More work is need to make it honor the config setting for printing

edit, this should handle other config options: 'bulk'=>$GLOBALS['Printer'] % 2 == 0?"bulkPrint(this)":"PDF_popup(filesLst,true)",

kneiser commented 6 years ago
  1. For the changes: edit, this should handle other config options: 'bulk'=>$GLOBALS['Printer'] % 2 == 0?"bulkPrint(this)":"PDF_popup(filesLst,true)", I assume that is meant for line 134? If so, it works as expected.
  2. After the changes are applied I notice now the single scanned images print button only allows the use of the user's workstation printers? As previously allowing selection of the user workstation printer? and server defined printers? For me that is not an issue, others it might.
GM-Script-Writer-62850 commented 6 years ago

line 138 not 134

kneiser commented 6 years ago

Ok it's all good!

GM-Script-Writer-62850 commented 6 years ago

Wait it actually worked with a trailing comma! Well that is unexpected, normally that would be a syntax error

Also the next update will fix the minor issue of asking to choose a print method when you forget to select files to print https://github.com/GM-Script-Writer-62850/PHP-Scanner-Server/blob/master/res/main.js#L850 &&files.length>0

kneiser commented 6 years ago

what is line 850 supposed to look liks after the update please?

GM-Script-Writer-62850 commented 6 years ago

if(print===true&&files.length>0){

kneiser commented 6 years ago

Ok I made the changes and did tests, all works great! Unless you can think of anything else I guess this issue can be closed. Thanks for the assistance!