FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian User

 
 
LinkBack Thread Tools
 
Old 01-05-2011, 04:53 AM
"John A. Sullivan III"
 
Default (solved) how to scan a book

On Tue, 2011-01-04 at 16:59 -0700, Bob Proulx wrote:
> Long Wind wrote:
> > Paul Cartwright wrote:
> > > if you take JPG pictures, you can open up OpenOffice Writer, import the
> > > JPEGs into a DOC & SAVE-AS PDF..
> >
> > Thank Paul Cartwright !
> > I'll try Writer later on.
>
> That is a good suggestion. But it sounds tedious to me.
>
> ImageMagick can convert images to pdf files on the command line.
>
> $ convert file1.jpg file1.pdf
>
> And pdftk can concatenate them.
>
> $ pdftk file*.pdf cat output combined.pdf
>
> You can install them with:
>
> $ sudo apt-get install imagemagick pdftk
>
> Bob
Seems like a week for PDF tricks! Just as we found the tip about
reducing PDF file size helpful and converted it to a KDE Konqueror
servicemenu, so we did for this suggestion to produce a PDF bind service
menu. In case it may be of use to anyone, here is the script:

#!/bin/bash
TITLE="PDF Binder"
FILES=""
DIR="${1}"
NEWFILE=""
OFILE=""
OK=true
kdialog --title "${TITLE}" --yesno "You must select your files one at a
time.
That is the only way I will know in which order to bind
them.
When you have finished selecting files, click cancel.
I will
then ask you where to save the bound file.
Shall I continue?"
if [ $? -ne 0 ];then
exit 4
fi
while true
do
NEWFILE="$(kdialog --title "Select PDF File to Bind" --getopenfilename
"${DIR}")"
if [ $? -ne 0 ];then
break
fi
if [ ! -f "${NEWFILE}" ];then
kdialog --title "${TITLE}" --error "The "${NEWFILE}" file does not
exist"
continue
fi
FILES="${FILES} "${NEWFILE}""
DIR="${NEWFILE%/*}"
done
if [ -z "${FILES}" ];then
kdialog --title "${TITLE}" --msgbox "No files were selected"
exit 5
fi
while ${OK}
do
OFILE="$(kdialog --title "Enter Bound File Name" --getsavefilename
"${DIR}")"
if [ $? -eq 0 ];then
EXT="${OFILE: -4:4}"
if [ "${EXT}" != ".pdf" -a "${EXT}" != ".PDF" ];then
OFILE="${OFILE}.pdf"
fi
if [ -f "${OFILE}" ];then
kdialog --title "${TITLE}" --warningyesno "The file
${OFILE} already exists.
Shall I overwrite it?"
if [ $? -ne 0 ];then
continue
fi
fi
OK=false
else
kdialog --title "${TITLE}" --yesno "Do you really want to cancel the
bind?"
if [ $? -eq 0 ];then
exit 6
fi
fi
done
FNAME="${OFILE##*/}"
DNAME="${OFILE%/*}"
kdialog --title "${TITLE}" --msgbox "PDF binding can take several
minutes.
You will be notified via popup when the process is
complete.
Thank you." &
eval pdftk ${FILES} cat output "${HOME}/tmp/${FNAME}"
ret=$?
if [ $ret -eq 0 ];then
mv "${HOME}/tmp/${FNAME}" "${OFILE}"
ret=$?
fi
if [ $ret -ne 0 ];then
rm -f "${HOME}/tmp/${FNAME}"
kdialog --title "${TITLE}" --error "PDF binding of ${OFILE}
failed."
exit 5
fi
kdialog --title "${TITLE}" --msgbox "PDF Binding Completed for:

${OFILE}"


And here is the service menu definition in
<KDEDIR>/share/apps/konqueror/servicemenus/39748-bindpdf.desktop:

[Desktop Action Bind_PDF]
Exec=/data/.Common/apps/PDFHandlers/bindpdf "%F"
Icon=kpdf
Name=Bind PDF file(s)

[Desktop Entry]
Actions=Bind_PDF
Encoding=UTF-8
ServiceTypes=application/pdf,application/vnd.adobe.pdf



--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 1294206800.20531.6.camel@denise.theartistscloset.c om">http://lists.debian.org/1294206800.20531.6.camel@denise.theartistscloset.c om
 

Thread Tools




All times are GMT. The time now is 04:10 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org