Re: [SLE] How to convert scanned pictures to a pdf book



I wrote a script that does just that.....

http://www.novell.com/coolsolutions/tools/17083.html
Details

Creating one pdf file from a directory of multiple .png scans.

Using kooka and my Cannon scanner, I have been scanning some articles
into my computer, these usually require several pages of scans, and I
save the images as .png files. Kooka saves the images in the format
kscan_0001.png , kscan_0002.png , and so on. As long as you scan in
pages in the same order you want them in the pdf, you won't have any
need to re-number the scanned image files. (You could save the scanned
files in almost any image format you wish. Simply change the script to
work with the image format you want to work with.)

The goal was to get ONE pdf document that was cross platform
compatible created from the multiple scans... all with minimal effort
on my part other than the scanning. Using bash, I created a quick
script to do the repetitive work.

What it does:
First it takes .png scans from the current directory and creates a
.pdf file for each one with imagemagick.
Then, with pdftk, all the .png scans are rolled into one larger .pdf file.

Code:

-------------------------------------------------------------------------------

#!/bin/bash
# FILE : makepdf.sh
# Function: Creates ONE pdf file from a directory of multiple png scans.
# Copyright (C) 2006 Dave Crouse <dave NOSPAMat usalug.org>
# ------------------------------------------------------------------------ #
#
# NOTES:
# Scans must be in .png format, or change the imagetype variable.
# Converts each png image file to a pdf file.
#

#######################
# VARIABLE: Change this to jpg, bmp, or whatever image file type your
converting from.
imagetype="png"
#######################

# Test to make sure required programs are installed.
if [[ -z $( type -p convert ) ]]; then echo -e "ImageMagick -- NOT
INSTALLED !";exit ;fi
if [[ -z $( type -p pdftk ) ]]; then echo -e "pdftk -- NOT INSTALLED !";exit ;fi

read -p "What would you like to name your new pdf file ? :" newname;
for i in *.${imagetype} ; do convert $i $i.pdf;done;
pdftk *.pdf cat output $newname.pdf;
for i in *.${imagetype} ; do rm -f $i.pdf;done;
echo "Conversion complete. PDF file ${newname}.pdf created.";

exit 0

-------------------------------------------------------------------------------

In my .bashrc file I have added:
alias makepdf='sh /home/crouse/Scripts/makepdf.sh'

From the bash shell, I just go into the directory where the scanned
images are, and type "makepdf" and create a pdf file with all the .png
images in that directory. Makes creating a pdf from multiple scans
painless.

For more info on the required programs:

Pdftk - is a command-line tool for manipulating PDF documents.
Home Page: http://www.accesspdf.com/pdftk/
Suse
Page: http://www.novell.com/products/linuxpackages/professional/pdftk.html

ImageMagick - is a robust collection of tools and libraries to read,
write, and manipulate an image in many image formats.
Home Page: http://www.imagemagick.org/
Suse
Page: http://www.novell.com/products/linuxpackages/professional/imagemagick.html




Hope that helps.
Crouse





On 10/24/06, Sunny <sloncho@xxxxxxxxx> wrote:
On 10/24/06, Ronald Wiplinger <ronald@xxxxxxxxx> wrote:
> I have scanned in 300 pages of pictures and want to "bind" it as a pdf book.
>
> I tried some ways, but I could not make it with so many pages.
>
> I am looking for a way, where all pages named as A00001, A00002 ......
> in one directory would be converted into one pdf file. Hereby, it should
> always add one page and not open all pages at once.
>
> Which program, script do you suggest for that?
>

Try using ImageMagick to convert every picture to PS, and then ps2pdf
to create 1 pdf per picture, and then pdftk for merging all resulting
pdfs.

--
Svetoslav Milenov (Sunny)

Even the most advanced equipment in the hands of the ignorant is just
a pile of scrap.

--
Check the headers for your unsubscription address
For additional commands send e-mail to suse-linux-e-help@xxxxxxxx
Also check the archives at http://lists.suse.com
Please read the FAQs: suse-linux-e-faq@xxxxxxxx




--
Check the headers for your unsubscription address
For additional commands send e-mail to suse-linux-e-help@xxxxxxxx
Also check the archives at http://lists.suse.com
Please read the FAQs: suse-linux-e-faq@xxxxxxxx



Relevant Pages

  • Re: Action keys missing in pdf file
    ... Current practice is to convert to Adobe PDF and release the pdf file ... Corporate has now released a new template file, ... Conversion of the slideshow to a pdf file is actually a "click on the pdf ...
    (microsoft.public.powerpoint)
  • Configuring IE to Use Adobe Reader 6.0 or Acrobat as Helper Applica
    ... To configure Adobe Reader 6.0.1 Open Reader, ... UNCHECK the box for "DISPLAY PDF IN BROWSER". ... >IE to use the Acrobat product as a helper applications. ... >Downloading a PDF File to Your Hard Disk ...
    (microsoft.public.windows.inetexplorer.ie6.browser)
  • Configuring IE to Use Adobe Reader 6.0 or Acrobat as Helper Applica
    ... To configure Adobe Reader 6.0.1 Open Reader, ... UNCHECK the box for "DISPLAY PDF IN BROWSER". ... >IE to use the Acrobat product as a helper applications. ... >Downloading a PDF File to Your Hard Disk ...
    (microsoft.public.windows.inetexplorer.ie6.browser)
  • Re: PDFs not encoded as base64
    ... then make sure that change didn't affect Acrobat or any other program that uses pdf files. ... the 1st 520 odd bytes are plain ascii and then the binary data ... If you look at the PDF file in Notepad, ... That will force the Base64. ...
    (microsoft.public.windows.inetexplorer.ie6_outlookexpress)
  • Re: [opensuse] Scanner and archiving
    ... flatbed scanner. ... echo "Insert page on scanner..." ... If you have multiple pages you want to end up in one PDF file, ...
    (SuSE)