Converting TIFF files to PDF and/or JPEG

billuseslinux at billuseslinux at
Tue Jan 17 19:17:42 EST 2006

The Tiff library and utilities combined with Ghostscript make this very

With the above two packages installed, you can do something like this
in Python:

def tiff2pdf(width, length, files):
        path, filename = os.path.split(files)
        name, ext = os.path.splitext(filename)
        output = os.path.join(path, name + ".pdf")
        command = \
        'tiff2ps -a2 -w%s -h%s "%s" | ps2pdf - "%s"' % (width, length,
files, output)

I use a function like this all the time to convert Tiffs to PDF.



More information about the Python-list mailing list