For Programmers: Free Programming Magazines  


Home > Archive > PostScript > January 2006 > How to create a PDF from multiple TIFFs ??









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author How to create a PDF from multiple TIFFs ??
Dave (from the UK)

2006-01-11, 9:57 pm

The thread "Batch processing of Postscript files to PDF"c got me thinking.

What is the best way to create a pdf file from multiple scanned images,
such as tiff files? I scanned using Gimp and the sane plug in, saved as
TIFF (for a record) then saved as PS too. Then I converted the few
hundred PS files to PDF with Ghostscript.

Is there a way of avoiding wring the PS files, or at least doing it as
one PS file, rather than a collection of hundred of them? I assume there
is a lot of overhead in embedding one image in one file, rather than
have all images in the one file.

I'm not a Winblows person, so I am primarily interested in UNIX methods.
--
Dave K

http://www.southminster-branch-line.org.uk/

Please note my email address changes periodically to avoid spam.
It is always of the form: month-year@domain. Hitting reply will work
for a couple of months only. Later set it manually. The month is
always written in 3 letters (e.g. Jan, not January etc)
Aandi Inston

2006-01-12, 3:58 am

"Dave (from the UK)"
<INVALID-see-signature-for-how-to-determine@southminster-branch-line.org.uk>
wrote:

>The thread "Batch processing of Postscript files to PDF"c got me thinking.
>
>What is the best way to create a pdf file from multiple scanned images,
>such as tiff files? I scanned using Gimp and the sane plug in, saved as
>TIFF (for a record) then saved as PS too. Then I converted the few
>hundred PS files to PDF with Ghostscript.
>
>Is there a way of avoiding wring the PS files, or at least doing it as
>one PS file, rather than a collection of hundred of them?


Yes, there are many direct TIFF to PDF converters, some of which will
do OCR (e.g. Acrobat Capture, which doesn't meet your preferences).
----------------------------------------
Aandi Inston quite@dial.pipex.com http://www.quite.com
Please support usenet! Post replies and follow-ups, don't e-mail them.

Michael Piotrowski

2006-01-12, 7:58 am

"Dave (from the UK)" <INVALID-see-signature-for-how-to-determine@southminster-branch-line.org.uk> writes:

> What is the best way to create a pdf file from multiple scanned
> images, such as tiff files? I scanned using Gimp and the sane plug
> in, saved as TIFF (for a record) then saved as PS too. Then I
> converted the few hundred PS files to PDF with Ghostscript.
>
> Is there a way of avoiding wring the PS files, or at least doing it as
> one PS file, rather than a collection of hundred of them? I assume
> there is a lot of overhead in embedding one image in one file, rather
> than have all images in the one file.
>
> I'm not a Winblows person, so I am primarily interested in UNIX methods.


LibTIFF <http://www.remotesensing.org/libtiff/> and PDFlib
<http://pdflib.com/products/pdflib/> contain useful tools for this
kind of task.

If you've got single-page (i.e., one image per file) TIFF files, you
can first use tiffcp from LibTIFF to consolidate them into a
multi-page TIFF file, e.g.:

$ tiffcp scan_01.tiff scan_02.tiff scan_03.tiff scan.tiff

This would give you a three-page file "scan.tiff" containing the
images from scan_01.tiff thru scan_03.tiff.

You would then use either tiff2pdf from LibTIFF or pdfimage from
PDFlib to convert the multi-page TIFF file into a PDF file:

HTH

--
Michael Piotrowski, M.A. <mxp@dynalabs.de>
Public key at <http://www.dynalabs.de/mxp/pubkey.txt>
Kai Birger Nielsen

2006-01-12, 7:58 am

In <x664opviw2.fsf@eurus.mag.dynalabs.de> Michael Piotrowski <mxp@dynalabs.de> writes:

>"Dave (from the UK)" <INVALID-see-signature-for-how-to-determine@southminster-branch-line.org.uk> writes:


[color=darkred]
>LibTIFF <http://www.remotesensing.org/libtiff/> and PDFlib
><http://pdflib.com/products/pdflib/> contain useful tools for this
>kind of task.


>If you've got single-page (i.e., one image per file) TIFF files, you
>can first use tiffcp from LibTIFF to consolidate them into a
>multi-page TIFF file, e.g.:


>$ tiffcp scan_01.tiff scan_02.tiff scan_03.tiff scan.tiff


>This would give you a three-page file "scan.tiff" containing the
>images from scan_01.tiff thru scan_03.tiff.


>You would then use either tiff2pdf from LibTIFF or pdfimage from
>PDFlib to convert the multi-page TIFF file into a PDF file:


>HTH


>--
>Michael Piotrowski, M.A. <mxp@dynalabs.de>
>Public key at <http://www.dynalabs.de/mxp/pubkey.txt>


I recently scanned a booklet in A5 format, where the easy thing was
to scan all left-pages first and then all right-pages. The scanner
had a "scan to pdf" option, so after scanning I had two pdf-files:
left.pdf and right.pdf. I used the pdftoppm command to extract
the pages as left-000001.ppm, left-000002.ppm etc and then wrote
a tiny script to create a lot of commands like:
pamflip -ccw left-000001.ppm > a.ppm
pamflip -cw right-000001.ppm > b.ppm
pnmcat -tb a.ppm b.ppm | pnmtops -quiet -scale 0.45 > page000001.ps

.....
pnmcat -tb a.ppm b.ppm | pnmtops -quiet -scale 0.45 > page000080.ps

and finally
cat page*ps | ghostscript -sDEVICE=pdfwrite -sOutputFile=booklet.pdf -

This turn a 160 pages booklet into an 80 pages pdf-document that I
could print doublesided.

Kind regards
--- Birger Nielsen (bnielsen@daimi.au.dk)
Ross Presser

2006-01-12, 7:04 pm

That's the long way around. pdftk can burst and combine pdf files
without the intermediate ppm steps.

George N. White III

2006-01-14, 7:57 am

On Thu, 12 Jan 2006, Dave (from the UK) wrote:

> The thread "Batch processing of Postscript files to PDF"c got me thinking.
>
> What is the best way to create a pdf file from multiple scanned images, such
> as tiff files? I scanned using Gimp and the sane plug in, saved as TIFF (for
> a record) then saved as PS too. Then I converted the few hundred PS files to
> PDF with Ghostscript.
>
> Is there a way of avoiding wring the PS files, or at least doing it as one PS
> file, rather than a collection of hundred of them? I assume there is a lot of
> overhead in embedding one image in one file, rather than have all images in
> the one file.
>
> I'm not a Winblows person, so I am primarily interested in UNIX methods.


I routinely generate pdf files containing 10's of remote sensing images
using a shell script to generate a .tex file with graphics include
commands and running that thru pdftex. My files annotate each image
with metadata. The images are first saved as .png, and when I'm being
careful about colors I use ImageMagick's convert to make PDF's (I don't
think pdftex's png import respects the gamma setting in the .png file).

--
George N. White III <aa056@chebucto.ns.ca>

toby

2006-01-17, 9:57 pm

Michael Piotrowski wrote:
> "Dave (from the UK)" <INVALID-see-signature-for-how-to-determine@southminster-branch-line.org.uk> writes:
>
>
> LibTIFF <http://www.remotesensing.org/libtiff/> and PDFlib
> <http://pdflib.com/products/pdflib/> contain useful tools for this
> kind of task.
>
> If you've got single-page (i.e., one image per file) TIFF files, you
> can first use tiffcp from LibTIFF to consolidate them into a
> multi-page TIFF file, e.g.:
>
> $ tiffcp scan_01.tiff scan_02.tiff scan_03.tiff scan.tiff
>
> This would give you a three-page file "scan.tiff" containing the
> images from scan_01.tiff thru scan_03.tiff.
>
> You would then use either tiff2pdf from LibTIFF or pdfimage from
> PDFlib to convert the multi-page TIFF file into a PDF file:


Yes, that's an ideal method, that I've also used. To get a very compact
PDF, you can ask tiffcp to use G4 (fax) compression ('-c g4') and then
use the default 'compression passthrough' feature on tiff2pdf (although
the latter utility uses G4 compression by default, on uncompressed TIFF
input). Both tiffcp and tiff2pdf are part of the libtiff package.

>
> HTH
>
> --
> Michael Piotrowski, M.A. <mxp@dynalabs.de>
> Public key at <http://www.dynalabs.de/mxp/pubkey.txt>


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com