Skip to content

Instantly share code, notes, and snippets.

@david0
Last active April 5, 2026 17:52
Show Gist options
  • Select an option

  • Save david0/f066299daf878e92903abe65e0f324a4 to your computer and use it in GitHub Desktop.

Select an option

Save david0/f066299daf878e92903abe65e0f324a4 to your computer and use it in GitHub Desktop.
Canon P-208 Mac/Linux

Canon P-208 Scanner on Mac OS/X

The original Canon CaptureOnTouch app does not work on newer Mac OS X versions. On Mac and Linux this scanner can be used with SANE.

  1. Install sane-backend

  2. Set Auto Start Switch on device to Off. Open the LID.

  3. scanimage -L should list scanner

    'canon_dr:libusb:020:005' is a CANON P-208II scanner 
    
  4. Insert paper and scan using scanimage --batch --source='ADF Duplex' --resolution=100 --format=tiff

The resulting tiffs can be postprocessed for example with tiff2pdf and then OCRing them with ocrmypdf

Debugging

Install with

sudo port install -s  sane-backends +debug configure.optflags="-O0"

Develop patches

Start with

sudo port patch sane-backends +debug configure.optflags="-O0"
# edit files change here
make

See debug messages

DYLD_LIBRARY_PATH=$(port work sane-backends)/sane-backends-1.3.1/backend/.libs  scanimage --batch --source='ADF Duplex'   --resolution=100  --format=tiff --mode=Gray -v
make barely white really white
even with calibartion there were stripes in the scanned page
--- backend/canon_dr.c
+++ backend/canon_dr.c
@@ -7625,7 +7625,7 @@ calibrate_fine_src_scan (struct scanner *s)
for(k=j;k<lines*s->s.Bpl;k+=s->s.Bpl){
max += s->buffers[i][k];
}
- s->f_gain[i][j] = max/lines;
+ s->f_gain[i][j] = (max/lines) - 20; // subtract 20 to get rid of stripes
if(s->f_gain[i][j] < 1)
s->f_gain[i][j] = 1;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment