Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Duplex Scanning #56

Open
ShadesJeff opened this issue Apr 10, 2021 · 9 comments
Open

Support Duplex Scanning #56

ShadesJeff opened this issue Apr 10, 2021 · 9 comments

Comments

@ShadesJeff
Copy link

When using the ADF on my scanner, even if airsaned sets the input source to ADF Duplex it does not load (buffer) the backside images and transfer them via the NextDocument request from the client application.

When doing duplex scanning with an ADF, I would expect airsaned to transfer 2 x [number of pages] images through multiple calls to NextDocument. The client application should then compile the files as appropriate into many single-page documents or into a single multi-page document depending on settings.

@elsiehupp
Copy link

I don’t know if there’s much I can add to the coding process in your fork, but I’d be happy to test any changes you make.

@ShadesJeff
Copy link
Author

Hi @elsiehupp - if you could test the modifications on the devel branch, that would be awesome. If they work out, hopefully they can be integrated into the main project at some point. Thanks!

@c-goes
Copy link

c-goes commented Aug 16, 2021

I can scan two sides of a page into a PDF with scansnap using the web application. But in macOS there is no option to scan duplex as far as I can see.

@SimulPiscator
Copy link
Owner

In macOS, you only have the option to choose between flatbed and ADF. To scan multiple pages from the ADF, choose PDF as output format, and check "Scan into single document" below the output format drop-down menu.

@c-goes
Copy link

c-goes commented Aug 16, 2021

In macOS, you only have the option to choose between flatbed and ADF. To scan multiple pages from the ADF, choose PDF as output format, and check "Scan into single document" below the output format drop-down menu.

I tried this in macOS but it only scans one side of each paper.

@ShadesJeff
Copy link
Author

The base AirSane code does not have the capability to buffer the back-side scan from a duplex scanner. My fork has some very rudimentary buffering capability and, at least for me with a ScanSnap ix500, works for duplex scanning and with hardware edge detection (page length detection) also available and working. If a few people test it with various hardware variations and it works, then I will submit a pull request.

@elsiehupp
Copy link

It seems like there are a lot of limitations inherent to Apple’s particular implementation of the draft PWG Network Scan Service specification. Like apparently what happened is that nobody except Apple and HP really bothered to try implementing it (as AirScan and eSCL, respectively), so there hasn’t been much initiative to iterate on it and fix its peculiar bugs and quirks.

My impression is that it would be possible to implement a fuller feature set by modernizing Mattias Ellert’s TWAIN SANE Interface for MacOS X, which translates SANE into TWAIN on the Mac end, rather than on the Linux end. The issue is that the existing binaries are 32-bit only, so they don’t run on more recent versions of macOS, and the existing codebase doesn’t compile as-is in the current version of Xcode.

(Incidentally, Epson seems to use something more like Ellert’s approach, with a proprietary API connecting their network scanners to a TWAIN driver on the client end. The main downside of this approach is that requiring third-party drivers means that hardware doesn’t “just work”, which was the impetus behind Apple’s AirPrint implementation of the IPP protocol. For USB printers Apple just preloads literally gigabytes’ worth of drivers onto macOS, but they haven’t seemed particularly inclined to do anything similar with scanners, beyond providing a native TWAIN API.)

Anyway...I copied all of the sources linked from Mattias Ellert’s website into a GitHub repository a while back, but I haven’t really done anything with it, yet, because native Mac development is still a bit beyond me at this point. Obviously feel free to poke around in his code, if you feel so inclined, and I hope it’s helpful that I put it all in a single GitHub repository (since it was only available as a collection of disconnected web downloads previously).

@markosjal
Copy link

I know that some Canon scanner drivers have the ability to delete blank pages with some settings. Maybe this is something the SANE driver lacks and you have discovered a good motivation for it?

for eSCL....
Duplex scanners MUST be identified in the ScannerCapabilities with
<scan:AdfDuplexInputCaps>
and in the Avahi/Bonjour announcement with
duplex=T

Maybe first you should ensure that these parameters are properly passed from SANE to AirSane and advertised correctly on the network

OSX has no duplex/simplex setting that I have ever seen

in comparison.....
I can scan on a Canon imageFormula 215 (duplex scanner which has no drives for OSX Catalina) to OSX Catalina by way of my Windows host (server) running Twain2AirScan , but the windows driver seems to do a good job at deleting the blank pages though even when I insert all single sided pages.

This is why I say that for some of these scanners eliminating blank pages seems to be a part of the driver, and a necessary part it seems.

@SimulPiscator
Copy link
Owner

I have modified AirSane to improve behavior with ADFs. Please give it a try.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants