LinuxQuestions.org
Have you heard the LinuxQuestions.org Podcast?
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.

Notices

Reply
 
Thread Tools Search this Thread
Old 04-28-2003, 10:01 AM   #1
Kostko
Member
 
Registered: Aug 2002
Distribution: Debian
Posts: 57
Thanked: 0
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, 03:13 PM   #2
nakkaya
Guru
 
Registered: Jan 2003
Location: Turkey&USA
Distribution: Emacs and linux is its device driver(Slackware,redhat)
Posts: 1,398
Thanked: 0
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, 03:31 PM   #3
Kostko
Member
 
Registered: Aug 2002
Distribution: Debian
Posts: 57
Thanked: 0

Original Poster
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, 10:01 AM   #4
mtb
Member
 
Registered: Nov 2002
Location: Italy
Distribution: Debian Etch
Posts: 258
Thanked: 0
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, 05:22 AM   #5
Kostko
Member
 
Registered: Aug 2002
Distribution: Debian
Posts: 57
Thanked: 0

Original Poster
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 05:25 AM..
Kostko is offline     Reply With Quote
Old 05-02-2003, 03:12 PM   #6
mtb
Member
 
Registered: Nov 2002
Location: Italy
Distribution: Debian Etch
Posts: 258
Thanked: 0
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, 06:16 AM   #7
Kostko
Member
 
Registered: Aug 2002
Distribution: Debian
Posts: 57
Thanked: 0

Original Poster
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, 11:47 AM   #8
Kostko
Member
 
Registered: Aug 2002
Distribution: Debian
Posts: 57
Thanked: 0

Original Poster
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, 01:12 PM   #9
mtb
Member
 
Registered: Nov 2002
Location: Italy
Distribution: Debian Etch
Posts: 258
Thanked: 0
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, 01:33 PM   #10
Kostko
Member
 
Registered: Aug 2002
Distribution: Debian
Posts: 57
Thanked: 0

Original Poster
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, 07:23 AM   #11
mtb
Member
 
Registered: Nov 2002
Location: Italy
Distribution: Debian Etch
Posts: 258
Thanked: 0
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


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
PDF to DOC Converter? vivek.sonny.abraham Linux - Software 11 07-04-2009 10:22 PM
pdf converter program bartgymnast Linux - Software 21 01-27-2006 11:13 AM
Pdf Converter free Software James_dean Linux - Software 4 10-14-2005 01:58 AM
CMD line tool for PDF -> HTML or JPG/PNG/GIF ilhbutshm Linux - Software 5 10-23-2004 05:18 AM
Linux RedHat 9.0 PDF to Word converter lamby Linux - Newbie 2 06-22-2004 07:45 PM


All times are GMT -5. The time now is 06:31 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.
Advertisement
Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Click Here to receive a complimentary subscription courtesy of LQ.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
RSS2  LQ Podcast
RSS2  LQ Radio
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration