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 27 Nov 2014, 00:42
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 Posts_count  
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_website 
Dingo


Joined: 11 Dec 2007
Posts: 1423
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_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_website 
Dingo


Joined: 11 Dec 2007
Posts: 1423
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_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_website 
Display_posts:   Sort by:   
Page 1 of 1 Posts_count  
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
 Forum index » House Training » Users ( For the regulars )
Jump to:  

Rules_post_cannot
Rules_reply_cannot
Rules_edit_cannot
Rules_delete_cannot
Rules_vote_cannot
You cannot attach files in this forum
You can download files in this forum


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