LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 06-26-2008, 01:47 PM   #1
mauran
LQ Newbie
 
Registered: Dec 2005
Location: Sri Lanka
Distribution: unbuntu 7.04
Posts: 17

Rep: Reputation: 0
how to convert an Image folder to a PDF file


Hello,

Are there any tools available on GNU/Linux to convert a "folder full' images into a single pdf file?

Any Nautilus scripts for do that?

Thanks in advance


-M.Mauran

Last edited by mauran; 06-26-2008 at 01:48 PM. Reason: image, pdf, convert, nautilus, script
 
Old 06-26-2008, 03:19 PM   #2
rjlee
Senior Member
 
Registered: Jul 2004
Distribution: Ubuntu 7.04
Posts: 1,991

Rep: Reputation: 76
I would look at ImageMagick; it has many options for converting files between different types.

One option is to convert each file to postscript, perhaps centred on an A4 or letter page, and then use the ps2pdf program (not part of ImageMagick) to convert to PDF.
 
Old 06-26-2008, 03:25 PM   #3
mauran
LQ Newbie
 
Registered: Dec 2005
Location: Sri Lanka
Distribution: unbuntu 7.04
Posts: 17

Original Poster
Rep: Reputation: 0
Thanks rjlee.

But my need is bit different.
It is a big project and I want to convert big number of folders into pdfs.

All i need is, right click a folder and "convert images to pdf" option.

OR

command line tool like

$img2pdf *.jpg


-M.Mauran
 
Old 06-28-2008, 04:24 AM   #4
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2020 CentOS6.10 CentOS7.7 + 50+ other Linux OS, for test only.
Posts: 17,397

Rep: Reputation: 3611Reputation: 3611Reputation: 3611Reputation: 3611Reputation: 3611Reputation: 3611Reputation: 3611Reputation: 3611Reputation: 3611Reputation: 3611Reputation: 3611
Have a look at this, it's a perl script to be used free for some time (shareware)
http://freshmeat.net/projects/jpg2pdf/

Rgds
 
Old 06-28-2008, 07:09 PM   #5
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2020 CentOS6.10 CentOS7.7 + 50+ other Linux OS, for test only.
Posts: 17,397

Rep: Reputation: 3611Reputation: 3611Reputation: 3611Reputation: 3611Reputation: 3611Reputation: 3611Reputation: 3611Reputation: 3611Reputation: 3611Reputation: 3611Reputation: 3611
Ref. #4
Just made a test on the suggested tool, 128 jpg images in a
directory were copied into one big pdf file with one command.

Rgds

Last edited by knudfl; 06-30-2008 at 04:23 PM.
 
Old 06-28-2008, 07:40 PM   #6
amani
Senior Member
 
Registered: Jul 2006
Location: Kolkata, India
Distribution: Debian 64-bit GNU/Linux, Kubuntu64, Fedora QA, Slackware,
Posts: 2,766

Rep: Reputation: Disabled
All you need to do is
1. batch convert each of the .jpg to .pdf (with imagemagick )
2. merge the pdfs into a single pdf with say pdftk, pdfmerge, etc

or

#convert *.jpg *.pdf && convert *.pdf -adjoin abc.pdf

You may need to pass more options

see man convert

man imagemagick
 
Old 12-01-2012, 09:55 AM   #7
bolet
LQ Newbie
 
Registered: Mar 2010
Posts: 6

Rep: Reputation: 0
A few years later...

convert file.jpg file.pdf
produces a pdf file which just includes the jpeg data, and is often smaller than the jpg file.

But
convert *.pdf -adjoin output.pdf
produces a pdf file which is a lot larger than the sum of its inputs.

As an alternative I found
pdfunite *.pdf result.pdf
which adds no overhead in the resulting pdf file.

I hope it helps someone out there !
 
Old 12-01-2012, 10:05 AM   #8
libCog
LQ Newbie
 
Registered: Aug 2011
Posts: 23

Rep: Reputation: Disabled
Code:
for jpg_fn in *.jpg
do
  convert $jpg_fn ${jpg_fn%.jpg}.pdf
done
pdftk *.pdf cat output all.pdf
 
Old 12-01-2012, 10:24 AM   #9
amani
Senior Member
 
Registered: Jul 2006
Location: Kolkata, India
Distribution: Debian 64-bit GNU/Linux, Kubuntu64, Fedora QA, Slackware,
Posts: 2,766

Rep: Reputation: Disabled
pdfunite is derived from pdfmerge. Both of them maintain resolution.
convert does it in a more complex way.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Copying image using acroread from pdf file xptools Linux - General 9 04-15-2009 05:27 AM
How to Convert Pct File into PDF alok_mits Linux - Software 1 07-10-2007 03:15 AM
Is there a way to convert a PDF file to another format? M$ISBS General 10 05-09-2007 02:43 AM
how to convert pdf file to doc format. thushara Linux - Newbie 3 03-22-2005 07:29 AM
Convert Open Office file to PDF file. liguorir Linux - Software 1 01-13-2004 01:44 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:58 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration