If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

PDF to JPG (and yes I know this is in Web Dev)

Hey Hey,

So as some of you know I've been doing a lot of php lately... I work for a marketing company and the end result will be an image library (completely custom) for a client... I was told I was working with JPGs and occasionally a Tif.... which is fine... I've just been informed that we're actually working with PDFs....

I'm basically looking for a way to convert the PDFs into JPGs or PNGs (which apparently ImageMagick's convert will do... however every time I've ran it I've crashed my dev. server)... I've found bulk conversion programs which would work just as well.... However they don't eliminate the white space..... Think a fully 8.5x11 page with about a 1x1 image on it... and all I want is that 1x1 image.

I've got a couple servers available to me for this.... FreeBSD and Windows 2000 are the ones that I was hoping to use in production (primarily the FreeBSD but I don't seem to be able to call convert on it)...

The other option is an inhouse debian server (my testbed) but then we're restricted to our DSL connection...

Anyways... anyone have any ideas or suggestions.... spending a bit of money won't be a problem... but yeah... I'm outta ideas.

Peace,
HT

IT Blog: .:Computer Defense:.PnCHd (Pronounced Pinched): Acronym - Point 'n Click Hacked. As in: "That website was pinched" or "The skiddie pinched my computer because I forgot to patch".

dont know if this will be off any help -&gt; http://www.verypdf.com/pdf2tif/help/help.htm
its a tool for extracting images from pdf's which then saves as .tiff
it also has a command line interface so you could call it from your scripts

Converting PDF's to JPG and then trimming is going to be resource intensive whatever you do.

As for the rest, do you know what is causing the JPG's to become corrupt?
Is it the initial conversion (try it without trimming)?
If not (and it is the trimming that is corrupting the images) then maybe there is an alternative method of trimming them?

Or maybe attack this from the other end? When the PDF's are made in the first place, make sure they are trimmed while being made.

Can you give us a timeline of the whole process from image source to final display in browser?

\"Clouds are not spheres, mountains are not cones, coastlines are not circles, and bark is not smooth,
nor does lightning travel in a straight line.\" -Benoit Mandelbrot

omin: It's actually proving to not be too resource intensive now... conversion without trim still corrupts the file... As for the PDFs being made... Our client has that done elsewhere, so unfortunately nothing can be done about that...

The timeline for the process (with the previous commands was

Browse to page -- 9 minutes pass -- image converted and displayed..

However the reason it was so resource intensive was because of the limited resources My p4 1.8 at work runs like **** (it's time for a reinstall but I have to find all the software I need first... still digging through boxes at work looking for some of it.. ) CoLinux (Debian) running on top of Windows XP on a 1.8 w/ 512MB of ram.. only 64 of which were dedicated to Debian..

I've since gotten all the software installed on our reseller account.. I've also moved from jpg to png.. they turn out well (no corruption) and less then 30 seconds per image with the command
convert test.pdf -trim test.png

Fanacool: Thanks but unfortunately i was looking for something bulk where I could just say eliminate white space and give me a jpg

Anyways I think the problem is solved (however imagemagick is core dumping on the server, so I have to figure out why and get that resolved.... then I"ll be laughing)

Peace,
HT

IT Blog: .:Computer Defense:.PnCHd (Pronounced Pinched): Acronym - Point 'n Click Hacked. As in: "That website was pinched" or "The skiddie pinched my computer because I forgot to patch".