473,378 Members | 1,671 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

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
Jul 18 '05 #1
2 2596
Ed Suominen <ed***@spam-eepatents.com> writes:
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.

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/
Jul 18 '05 #2
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:
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


Jul 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Keith Bowes | last post by:
I have a script for requesting HTTP resources and I want it to use HTTP compression (to reduce bandwidth), if possible. What's the best way to do this? I've tried using zlib functions but they...
2
by: Dan Williams | last post by:
Does anyone know of any Windows software to scan the same paper document and enter the results to an SQL Server database? We have a Photocopier machine that can automatically scan several...
5
by: Sally B. | last post by:
Hello, I searched, but couldn't find answers--probably because I'm not sure what this is called... Anyway, I have about 50 web pages and I want to have some JavaScript that will read in a list of...
6
by: Jack Orenstein | last post by:
Suppose I have a table as follows: testdb=> \d person Table "public.person" Column | Type | Modifiers ------------+-------------------------+----------- id |...
35
by: Friendly_Lola | last post by:
What Screen Resolution do You use? 800 X 600 1024 X 768 1280 X 1024 Wow! 1600 X 1200 (i can't imagine this) I use 1024 X 768. For what resolution you optimize your web pages?
0
by: sameer | last post by:
Hi all, ..net framwork 1.1 sql server 2000 I have a vb.net winforms application using webservices\ remoting to upload documents\ images to the webserver and i am gong to store them in the sql...
29
by: Nick | last post by:
I've seen a few frameworks use the following: function $(id) { return document.getElementById(id); } Then to use: $('something').innerHTML = 'blah'; I'm just trying to roll this out to my...
16
by: Nad | last post by:
I have a very large site with valuable information. Is there any way to prevent downloading a large number of articles. Some people want to download the entire site. Any hints or pointers would...
4
by: Arun Srinivasan | last post by:
Hi I was using a query previously, that was efficient select * from table where pred1 and pred2 and pred3; Later I was asked to introduce new ones, but they were not based on table columns but...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.