LinuxQuestions.org
Register a domain and help support LQ

Welcome to LinuxQuestions.org, a friendly and active Linux Community.

You are currently viewing LQ as a guest. By joining our community you will have access to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!

Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.

Are you new to LinuxQuestions.org? Visit the following links:
Site Howto | Site FAQ | Sitemap | Register Now

If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.

Go Back   LinuxQuestions.org > Forums > Linux > 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.

Reply
 
Thread Tools
Old 04-28-2003, 09:01 AM   #1
Kostko
Member
 
Registered: Aug 2002
Distribution: Debian
Posts: 57
PDF to PNG converter


[Log in to get rid of this advertisement]
Does a program for converting PDF files to PNG exist for linux ? I prefer one that can be used in a console, so i can use it in a script.

Kostko is offline     Reply With Quote
Old 04-28-2003, 02:13 PM   #2
nakkaya
Guru
 
Registered: Jan 2003
Location: Turkey&USA
Distribution: Emacs and linux is its device driver(Slackware,redhat)
Posts: 1,398
u can convert pdf to ps and then to png with gimp but i am not sure just an idea
nakkaya is offline     Reply With Quote
Old 04-28-2003, 02:31 PM   #3
Kostko
Member
 
Registered: Aug 2002
Distribution: Debian
Posts: 57
well, i have found a solution, convert tool from ImageMagick can do this, so i used it and it works great !
Kostko is offline     Reply With Quote
Old 04-30-2003, 09:01 AM   #4
mtb
Member
 
Registered: Nov 2002
Location: Italy
Distribution: Debian Etch
Posts: 245
Also with the netpbm package.

1st) pdf2ps

2nd) pstoppm

3rd) ppmtopng -compression 9

This way is usually faster [ imagemagick is very very slow, and for this way you can create a script ]

Quote:
Originally posted by Kostko
well, i have found a solution, convert tool from ImageMagick can do this, so i used it and it works great !
mtb is offline     Reply With Quote
Old 05-02-2003, 04:22 AM   #5
Kostko
Member
 
Registered: Aug 2002
Distribution: Debian
Posts: 57
Quote:
Originally posted by mtb
Also with the netpbm package.

1st) pdf2ps

2nd) pstoppm

3rd) ppmtopng -compression 9

This way is usually faster [ imagemagick is very very slow, and for this way you can create a script ]
so where can i get pstoppm and ppmtopng ? because i have netpbm package installed (in debian woody) but i don't have these commands.

---- EDIT ----
is it possible that it is pnm instead of ppm ? well it works, but is there a way to set the resolution (in dpi), because current results are pretty crappy

Last edited by Kostko : 05-02-2003 at 04:25 AM.
Kostko is offline     Reply With Quote
Old 05-02-2003, 02:12 PM   #6
mtb
Member
 
Registered: Nov 2002
Location: Italy
Distribution: Debian Etch
Posts: 245
Yes, excuse me it's pnm ( for what i understand ppm it's the same of pnm with a different name, even if i'm not sure - but i've wrote some image filters and they work fine on both ).

For the res i'll check ( windows now, crap modem ), but i think there is some option ( like in bmv, for this viewer is -r300 (eg.) where 300 is the # of dots per inch ) to modify the dpi.

Quote:
Originally posted by Kostko
so where can i get pstoppm and ppmtopng ? because i have netpbm package installed (in debian woody) but i don't have these commands.

---- EDIT ----
is it possible that it is pnm instead of ppm ? well it works, but is there a way to set the resolution (in dpi), because current results are pretty crappy
mtb is offline     Reply With Quote
Old 05-03-2003, 05:16 AM   #7
Kostko
Member
 
Registered: Aug 2002
Distribution: Debian
Posts: 57
well, i hope that this is really faster, because i need to convert about 108000 pdf files to png and imagemagick is slow (10 sec per file) :P
Kostko is offline     Reply With Quote
Old 05-03-2003, 10:47 AM   #8
Kostko
Member
 
Registered: Aug 2002
Distribution: Debian
Posts: 57
ok, i have tried with:
gs -dSAFER -dBATCH -dNOPAUSE -sDEVICE=pnggray -r300-sOutputFile=out.png in.pdf

and it sort of works, but the width and height of the pict is too big. is it possible to get the same output as if i do:

convert -density 300x300 -resize 1000x1000 in.pdf out.png

?
Kostko is offline     Reply With Quote
Old 05-03-2003, 12:12 PM   #9
mtb
Member
 
Registered: Nov 2002
Location: Italy
Distribution: Debian Etch
Posts: 245
I don't know. I have tried with:

pstopnm -xsize 1024 ( for example ) and you obtain a quite small file.


Quote:
Originally posted by Kostko
ok, i have tried with:
gs -dSAFER -dBATCH -dNOPAUSE -sDEVICE=pnggray -r300-sOutputFile=out.png in.pdf

and it sort of works, but the width and height of the pict is too big. is it possible to get the same output as if i do:

convert -density 300x300 -resize 1000x1000 in.pdf out.png

?
mtb is offline     Reply With Quote
Old 05-03-2003, 12:33 PM   #10
Kostko
Member
 
Registered: Aug 2002
Distribution: Debian
Posts: 57
well, still the bast quality and small png file is if i use imagemagick, but it takes about 10 seconds to process a single pdf file and i need to convert a huge amount of files and now it would take me about 2 weeks to complete the whole stuff on a 2ghz athlon. so is this the only choice ?
Kostko is offline     Reply With Quote
Old 05-05-2003, 06:23 AM   #11
mtb
Member
 
Registered: Nov 2002
Location: Italy
Distribution: Debian Etch
Posts: 245
I don't know what else i can suggest.

Maybe xnview [ a friend of mine told me something about this software ] - or irfan view for win?

Quote:
Originally posted by Kostko
well, still the bast quality and small png file is if i use imagemagick, but it takes about 10 seconds to process a single pdf file and i need to convert a huge amount of files and now it would take me about 2 weeks to complete the whole stuff on a 2ghz athlon. so is this the only choice ?
mtb is offline     Reply With Quote

Reply

Submit thread to Digg | Submit thread to del.icio.us | Submit to LQ Bookmarks

« Back to Top »

Thread Tools

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

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
PDF to DOC Converter? vivek.sonny.abraham Linux - Software 10 04-10-2008 05:45 AM
pdf converter program bartgymnast Linux - Software 21 01-27-2006 10:13 AM
Pdf Converter free Software James_dean Linux - Software 4 10-14-2005 12:58 AM
CMD line tool for PDF -> HTML or JPG/PNG/GIF ilhbutshm Linux - Software 5 10-23-2004 04:18 AM
Linux RedHat 9.0 PDF to Word converter lamby Linux - Newbie 2 06-22-2004 06:45 PM



Add LQ To Your Yahoo Add LQ To Your Google Add LQ To Your MSN Add LQ To Your Blog
All times are GMT -5. The time now is 11:47 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
RSS2  LQ Podcast
RSS2  LQ Radio
Open Source Consulting | Domain Registration