Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Thu 23 Oct 2014, 03:54
All times are UTC - 4
 Forum index » House Training » Users ( For the regulars )
How to put jpg files into a pdf?
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [5 Posts]  
Author Message
steve_s


Joined: 26 May 2008
Posts: 1545
Location: Austin, TX, USA

PostPosted: Sat 03 Jul 2010, 11:02    Post subject:  How to put jpg files into a pdf?  

I went to a training conference that was a week long. I took notes, of course.

Scanned 'em, now have a group of 30 or so jpg's labeled page1.jpg, page2.jpg, etc.

I need a command to compile/convert/assemble the jpg's to one pdf.

What do y'all suggest? Wink
Back to top
View user's profile Send private message Visit poster's website 
Dingo


Joined: 11 Dec 2007
Posts: 1422
Location: somewhere at the end of rainbow...

PostPosted: Sat 03 Jul 2010, 11:12    Post subject:  

Few simple steps: install

*sam2p*
- http://dokupuppylinux.co.cc/programs:image_converters?s[]=sam2p

use this script:

#!/bin/bash

directory=`pwd`

for file in $directory/*.jpg
do
filename=${file%.jpg}
sam2p $filename.jpg $filename.pdf
done


then join all pdfs together with

*pdftk*
- http://dokupuppylinux.co.cc/programs:pdf_manipulation?s[]=pdftk

parameters:

pdftk `ls *.pdf | sort -g| tr '\n' ' '` cat output out1.pdf

_________________
replace .co.cc with .info to get access to stuff I posted in forum
dropbox 2GB free
OpenOffice for Puppy Linux
Back to top
View user's profile Send private message Visit poster's website 
steve_s


Joined: 26 May 2008
Posts: 1545
Location: Austin, TX, USA

PostPosted: Sat 03 Jul 2010, 11:46    Post subject:  

Dingo, you rock, first and foremost.

It worked like a champ; I combined the two suggestions into one script and it worked like a champ EXCEPT....

They are out of order. Confused

Which means that it is converting them fine (I checked) and naming them great, but not ordering them correctly as it assembles them...you seem to be better at bash than I am (I'm quite certain of it) so what is missing?
Back to top
View user's profile Send private message Visit poster's website 
Dingo


Joined: 11 Dec 2007
Posts: 1422
Location: somewhere at the end of rainbow...

PostPosted: Sat 03 Jul 2010, 11:57    Post subject:  

this command

pdftk `ls *.pdf | sort -g| tr '\n' ' '` cat output out1.pdf

I usually use when I have images named like: 1.jpg, 2.jpg, 3.jpg...10.pdf, 20.pdf and so on... in other words, when I have images with non same-width filename

so I use -g option, to keep filenames by its numeric value

you can

or use normal (alphabetical order) but delete output pdf file first

pdftk *.pdf cat output out1.pdf

or you can rename your images taking care they have same filename width from page11, page2, page3 and so on... to 001.jpg, 002.jpg, 003.jpg and so on...and then join

_________________
replace .co.cc with .info to get access to stuff I posted in forum
dropbox 2GB free
OpenOffice for Puppy Linux
Back to top
View user's profile Send private message Visit poster's website 
steve_s


Joined: 26 May 2008
Posts: 1545
Location: Austin, TX, USA

PostPosted: Sat 03 Jul 2010, 12:18    Post subject:  

That's what I figured: that it had something to do with how I had named them.

I figured I could have searched around for the best way to batch change the names, yada, yada, or just quickly, manually change them each, which is what I did.

Then ran the your scripts, worked like a champ. Well done. Cool
Back to top
View user's profile Send private message Visit poster's website 
Display posts from previous:   Sort by:   
Page 1 of 1 [5 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » House Training » Users ( For the regulars )
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0667s ][ Queries: 11 (0.0244s) ][ GZIP on ]