Scan document pages to a compressed PDF

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Ed Suominen

    #1

    Scan document pages to a compressed PDF

    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

    #2
    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/

    Comment

    • Ed Suominen

      #3
      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."


      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]

      Comment

      Working...