LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 10-28-2011, 04:41 AM   #1
sholdon
LQ Newbie
 
Registered: Aug 2011
Posts: 2

Rep: Reputation: Disabled
How to convert PDF to jpg?


I have hundreds of multipage pdf documents that I would like to save out as jpg's files.
I know I can convert them individually but if anyone knows a program that could do this for me automatically that would be great
 
Old 10-28-2011, 05:01 AM   #2
colucix
Moderator
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957
If you have ImageMagick it's easy as
Code:
convert file.pdf file.jpg
this will create a JPEG for every single page of the original document. If you want to improve the quality, you can try some options, e.g
Code:
convert -colorspace RGB -interlace none -density 300x300 -quality 100 file.pdf file.jpg
To do multiple conversions, you can do a loop:
Code:
for file in *.pdf
do
 convert -colorspace RGB -interlace none -density 300x300 -quality 100 $file ${file/pdf/jpg}
done

Last edited by colucix; 10-28-2011 at 05:02 AM.
 
3 members found this post helpful.
Old 12-05-2011, 01:22 PM   #3
libCog
LQ Newbie
 
Registered: Aug 2011
Posts: 23

Rep: Reputation: Disabled
If these PDFs are simply scans (raster, not vector), then "converting" is not the best approach. In this case, you should simply extract the images from the PDF container using "pdfimages" (it's stock on most distros). It's easy to script something using pdfimages.

If these are vector PDFs, then I don't know what's the best approach.. perhaps ImageMagick.. although I think I recall IM having issues with vector PDFs.
 
1 members found this post helpful.
Old 12-05-2011, 04:56 PM   #4
jefro
Guru
 
Registered: Mar 2008
Posts: 11,747

Rep: Reputation: 1445Reputation: 1445Reputation: 1445Reputation: 1445Reputation: 1445Reputation: 1445Reputation: 1445Reputation: 1445Reputation: 1445Reputation: 1445
http://www.medicalnerds.com/batch-co...free-software/
 
Old 12-05-2011, 11:15 PM   #5
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654
Do you want to convert every page of a multipage PDF and convert it to an image?
Do these PDFs contain collections of photo's that you want to extract, or are they regular PDFs with text?

The poppler-tools package contains pdf processing programs including the "pdfimages" program.
To convert every page of a pdf to an image, there is the "pdftoppm" program. Can then use ImageMagick's "convert" program to convert the ppm files to jpegs or another image format.
 
  


Reply

Tags
convert, document, jpg, pdf


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
convert multiple jpg files into pdf Brocolli Linux - Software 5 05-08-2013 09:43 AM
Using imagemagick to convert numerous jpg files to single pdf jrtayloriv Linux - Software 7 05-03-2013 05:13 AM
[SOLVED] Using convert from imagemagick package to convert multiple jpg files janis_169 Linux - Newbie 5 07-18-2010 04:22 PM
HELP! BASH - Convert filenames from dsc00***.jpg to *.jpg jimmybond01 Programming 9 05-08-2007 06:17 AM
Convert pdf to html or txt or remaster the pdf? jago25_98 Linux - Software 1 12-13-2005 01:11 AM


All times are GMT -5. The time now is 06:20 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration