browse: forums | FAQ
Connecting Tech Pros Worldwide

Hey there! Do you need Python help?

Get answers from our community of Python experts on BYTES! It's free.

Scan document pages to a compressed PDF

Ed Suominen
Guest
 
Posts: n/a
#1: Jul 18 '05
I'd like to write a Python-based commandline tool that will scan pages with
SANE, applying CCITT Group 4 compression during scanning, and produce a
single PDF file. I would release it under GPL. Right now, I'm relying on a
workable but inflexible shell script that pipes stuff between scanimage,
tiffcp, tiff2ps, and ps2pdf.

What's the best way currently to do CCITT4 compression (e.g., of
intermediate TIFF-format images) from Python? PIL doesn't seem to support
CCITT4 compression, and the read-only patch [1] that's available won't help
in my case. I'd like to incorporate as much as possible into the Python
code and imported packages, rather than relying on pipes to a bunch of
external programs.

Same question regarding SANE -- I can't seem to find the supposed PIL
support for SANE in the release on my system. Anyone know about that, or
alternatives?

---
Ed Suominen
Registered Patent Agent
Open-Source Software Author (yes, both...)
Web Site: http://www.eepatents.com

[1] http://mail.python.org/pipermail/ima...ly/002354.html



Paul Rubin
Guest
 
Posts: n/a
#2: Jul 18 '05

re: Scan document pages to a compressed PDF


Ed Suominen <ed-no@spam-eepatents.com> writes:[color=blue]
> What's the best way currently to do CCITT4 compression (e.g., of
> intermediate TIFF-format images) from Python? PIL doesn't seem to support
> CCITT4 compression, and the read-only patch [1] that's available won't help
> in my case. I'd like to incorporate as much as possible into the Python
> code and imported packages, rather than relying on pipes to a bunch of
> external programs.[/color]


I ended up doing about the same thing as you, generating shell scripts
to run existing command line stuff.

This might also be of some interest: http://tumble.brouhaha.com/
Ed Suominen
Guest
 
Posts: n/a
#3: Jul 18 '05

re: Scan document pages to a compressed PDF


Replying to my own post, this looks like a very promising tool:

"Pytiff is a library for using TIFF files and advanced imaging in Python."
http://pubweb.northwestern.edu/~omh2...ff/pytiff.html

Ed Suominen wrote:
[color=blue]
> I'd like to write a Python-based commandline tool that will scan pages
> with SANE, applying CCITT Group 4 compression during scanning, and produce
> a single PDF file. I would release it under GPL. Right now, I'm relying on
> a workable but inflexible shell script that pipes stuff between scanimage,
> tiffcp, tiff2ps, and ps2pdf.
>
> What's the best way currently to do CCITT4 compression (e.g., of
> intermediate TIFF-format images) from Python? PIL doesn't seem to support
> CCITT4 compression, and the read-only patch [1] that's available won't
> help in my case. I'd like to incorporate as much as possible into the
> Python code and imported packages, rather than relying on pipes to a bunch
> of external programs.
>
> Same question regarding SANE -- I can't seem to find the supposed PIL
> support for SANE in the release on my system. Anyone know about that, or
> alternatives?
>
> ---
> Ed Suominen
> Registered Patent Agent
> Open-Source Software Author (yes, both...)
> Web Site: http://www.eepatents.com
>
> [1] http://mail.python.org/pipermail/ima...ly/002354.html[/color]

Closed Thread