sane-canon_dr(5)
π sane-canon_dr π
okay bestie, welcome to the Canon DR-series corner of SANE β that's Scanner Access Now Easy if you're new here, which, no shade, most people are. This is the manual for the sane-canon_dr backend, and yes it's giving very "I reverse engineered this myself and I have receipts" energy. Buckle up. π
π NAME π
sane-canon_dr β the SANE backend for Canon DR-series scanners. that's the whole vibe. β¨
β¨ DESCRIPTION β¨
The sane-canon_dr library implements a SANE (Scanner Access Now Easy) backend, and what it does is give you access to some Canon DR-series scanners. not all of them. some. we'll get to that. π
This doc right here describes backend version 60, which shipped with SANE 1.0.32. write that down. π«Ά
π¦ SUPPORTED HARDWARE π¦
okay so real talk: this version has only been tested with a few scanner models. a few. like, don't come for me. for the most recent list, go look at:
http://www.sane-project.org/sane-supported-devices.html
This backend may support other Canon scanners too. The best way to find out your level of support is either to test the scanner directly, or to collect a trace of the windows driver in action. Please contact the author for help or with test results β they literally want your data, this is a group project fr fr. π
In general, the larger machines (DR-4000 and up) that have been tested use a fairly complete protocol, with hardware support for many modes, resolutions and features. slay. β¨
The smaller machines have many limitations, like:
- missing horizontal resolutions
- missing binary mode
- always scanning full-width
- etc. π
There is code in the backend to address these problems, but there seems to be no way to detect if they are required, so they must be hard-coded. no cap, that's just how it is. π
π OPTIONS π
Effort has been made to expose most hardware options, including:
--source Flatbed|ADF Front|ADF Back|ADF Duplexβ Selects the source for the scan.--mode Lineart|Halftone|Gray|Colorβ Selects the mode for the scan.--resolutionβ Controls scan resolution.--tl-x,--tl-y,--br-x,--br-yβ Sets scan area upper left and lower right coordinates. These are renamed-t,-l,-x,-yby some frontends. (iykyk, frontends love a little rename π)--page-width,--page-heightβ Sets paper size. Used by scanner to determine centering of scan coordinates when using the ADF (Automatic Document Feeder) and to detect double feed errors.
Other options will be available based on the capabilities of the scanner: enhancement, compression, buttons and sensors, etc.
π the "software" options (plot twist) π
Additionally, several 'software' options are exposed by the backend. These are reimplementations of features provided natively by larger scanners, but running on the host computer. This enables smaller machines to have similar capabilities. main character energy for the little scanners honestly.
Please note that these features are somewhat simplistic, and may not perform as well as the native implementations. Note also that these features all require that the driver cache the entire image in memory. This will almost certainly result in a reduction of scanning speed. π
--swcropβ Requests the driver to detect the extremities of the paper within the larger image, and crop the empty edges. βοΈ--swdeskewβ Requests the driver to detect the rotation of the paper within the larger image, and counter the rotation. π--swdespeck Xβ Requests the driver to find and remove dots ofXdiameter or smaller from the image, and fill the space with the average surrounding color.
Use scanimage --help to get a list, but be aware that some options may be settable only when another option has been set, and that advanced options may be hidden by some frontend programs. (sneaky. π)
πΈ CONFIGURATION FILE πΈ
The configuration file canon_dr.conf is used to tell the backend how to look for scanners, and provide options controlling the operation of the backend. This file is read each time the frontend asks the backend for a list of scanners, generally only when the frontend starts.
If the configuration file is missing, the backend will fail to run. so like. make the file bestie. π
Scanners can be specified in the configuration file in 4 ways:
"scsi CANON DR"β Requests backend to search all scsi buses in the system for a device which reports itself to be a scanner made by 'CANON', with a model name starting with 'DR'."scsi /dev/sg0"(or other scsi device file) β Requests backend to open the named scsi device. Only useful if you have multiple compatible scanners connected to your system, and need to specify one. Probably should not be used with the other"scsi"line above."usb 0x04a9 0x1603"(or other vendor/product ids) β Requests backend to search all usb buses in the system for a device which uses that vendor and product id. The device will then be queried to determine if it is a Canon scanner."usb /dev/usb/scanner0"(or other device file) β Some systems use a kernel driver to access usb scanners. This method is untested. π
β¨ the option lines β¨
Besides the 'scsi' and 'usb' lines, the configuration file supports the following 'option' lines:
"option buffer-size [number of bytes]"β Set the number of bytes in the data buffer to something other than the compiled-in default of 4MB. Large values may cause timeouts or hangs, small values may cause slow scans.
Note: The backend does not place an upper bound on this value, as some users required it to be quite large. Values above the default are not recommended, and may crash your OS or lockup your scsi card driver. You have been warned. π
"option vendor-name [string of text]""option model-name [string of text]""option version-name [string of text]"β These options can be used collectively to override the values provided by the scanner, or to provide the values when the scanner cannot."option padded-read [0|1]"β Some scanners prepend all data transmitted to host with 12 bytes. Enable this option if the scanner fails to respond to commands."option duplex-offset [integer]"β Some scanners pad the upper edge of one side of a duplex scan. There is some variation in the amount of padding. Modify this option if your unit shows an unwanted band of image data on only one side.
NOTE: "option" lines may appear multiple times in the configuration file. They only apply to scanners discovered by the next 'scsi/usb' line. so order matters, bestie. π
π ENVIRONMENT π
The backend uses a single environment variable, SANE_DEBUG_CANON_DR, which enables debugging output to stderr. Valid values are:
5 Errors
10 Function trace
15 Function detail
20 Option commands
25 SCSI/USB trace
30 SCSI/USB detail
35 Useless noise
35 being literally labeled Useless noise is iconic and I respect it so much. πβ¨
π KNOWN ISSUES π
This backend was entirely reverse engineered from usb traces of the proprietary driver. Various advanced features of the machines may not be enabled. Many machines have not been tested. Their protocol is unknown.
ngl that's a whole mood. we're doing our best out here. π«Ά
π«Ά CREDITS π«Ά
- The various authors of the
sane-fujitsu(5)backend provided useful code. - Yabarana Corp.
www.yabarana.comprovided significant funding. - EvriChart, Inc.
www.evrichart.comprovided funding and loaned equipment. - Canon, USA.
www.usa.canon.comloaned equipment. - HPrint
hprint.com.brprovided funding and testing for DR-2510 support. - Stone-IT
www.stone-it.comprovided funding for DR-2010 and DR-2050 support. - Gerhard Pfeffer provided access and testing for P-208 and P-215.
- Special thanks to: Alejandro Imass, Andre Shimakawa, Martijn van Brummelen, Thanos Diacakis and Junren Shi for testing and feedback.
the way the whole community showed up for this backend?? obsessed. π₯Ήπ
π SEE ALSO π
β AUTHOR β
m. allan noah: <kitno455 a t gmail d o t com>.
(yes you have to mentally de-obfuscate the email, that's just how the manpage does it, we don't make the rules π )
okay that's the whole page bestie, go scan something iconic. this was sane-canon_dr(5), backend version 60, from the SANE crew, dated 13 Feb 2021. slay, periodt, go forth and feed your ADF. πβ¨π¦π
π¦ where this page comes from
- alpine 3.24: sane-doc 1.4.0-r4 Β· GPL-2.0-or-later GPL-2.0-or-later-with-sane-exception Public-Domain
- arch rolling: sane 1.4.0-4 Β· GPL-2.0-or-later AND LicenseRef-GPL-2.0-or-later-with-linking-exception
- centos-stream 10: sane-backends 1.2.1-10.el10 Β· GPL-2.0-or-later WITH SANE-exception AND GPL-2.0-or-later AND GPL-2.0-only AND LGPL-2.0-or-later AND LGPL-2.1-or-later AND LicenseRef-Fedora-Public-Domain AND IJG AND MIT
- debian bookworm: libsane-common 1.2.1-2 Β· GPL-2.0-or-later WITH sane exception
- debian trixie: libsane-common 1.3.1-3 Β· GPL-2.0-or-later WITH sane exception
- fedora 43: sane-backends 1.4.0-4.fc43 Β· GPL-2.0-or-later WITH SANE-exception AND GPL-2.0-or-later AND GPL-2.0-only AND LGPL-2.0-or-later AND LGPL-2.1-or-later AND LicenseRef-Fedora-Public-Domain AND IJG AND MIT
- fedora 44: sane-backends 1.4.0-6.fc44 Β· GPL-2.0-or-later WITH SANE-exception AND GPL-2.0-or-later AND GPL-2.0-only AND LGPL-2.0-or-later AND LGPL-2.1-or-later AND LicenseRef-Fedora-Public-Domain AND IJG AND MIT
- nixos 26.05: sane-backends 1.4.0
- nixpkgs unstable: sane-backends 1.4.0
- opensuse-leap 16.0: sane-backends 1.3.0-bp160.1.14 Β· GPL-2.0-or-later AND SUSE-GPL-2.0+-with-sane-exception AND SUSE-Public-Domain
- opensuse-leap 16.0: sane-backends 1.3.0-bp160.1.14 Β· GPL-2.0-or-later AND SUSE-GPL-2.0+-with-sane-exception AND SUSE-Public-Domain
- opensuse-leap 16.0: sane-backends 1.3.0-bp160.1.14 Β· GPL-2.0-or-later AND SUSE-GPL-2.0+-with-sane-exception AND SUSE-Public-Domain
- opensuse-leap 16.0: sane-backends 1.3.0-bp160.1.14 Β· GPL-2.0-or-later AND SUSE-GPL-2.0+-with-sane-exception AND SUSE-Public-Domain
- ubuntu jammy: libsane-common 1.1.1-5 Β· GPL-2.0-or-later WITH sane exception
- ubuntu noble: libsane-common 1.2.1-7build4 Β· GPL-2.0-or-later WITH sane exception
- ubuntu questing: libsane-common 1.3.1-4build1
- ubuntu resolute: libsane-common 1.4.0-1ubuntu1 Β· GPL-2.0-or-later WITH sane exception
- ubuntu stonking: libsane-common 1.4.0-1ubuntu2 Β· GPL-2.0-or-later WITH sane exception
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms