Results 1 to 6 of 6

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

  1. #1
    Senior Member
    Join Date
    Jan 2003
    Posts
    3,915

    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

  2. #2
    dont know if this will be off any help -> 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

  3. #3
    Senior Member
    Join Date
    Jan 2003
    Posts
    3,915
    Hey Hey,

    Same problem as the other software... no white space elimination.. Thanks though.


    Imagemagick seems to be my best bet

    convert test.pdf -trim test.jpg will leave me with only the image portion all the white space removed.

    Problem is it's very resource intensive and It leaves me with corrupt images.. I can view them in Explorer and Macromedia/Adobe software.... but not in a browser...

    Peace,
    HT

  4. #4
    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

  5. #5
    Did someone said Pizza :) FanacooL's Avatar
    Join Date
    Oct 2004
    Location
    Karachi , Pakistan
    Posts
    466
    Try using Tech Smith Snagit 7.0, you can select an area or frame and there are other options in too.
    Try hope this might be helpful to you.
    One machine can do the work of fifty ordinary men. No machine can do the work of one extraordinary man!

  6. #6
    Senior Member
    Join Date
    Jan 2003
    Posts
    3,915
    Hey Hey,

    Thanks for the advice everyone..

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •