Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 265
  • Last Modified:

Auto create images from PDF

I wounder if it is possible to..........

1. Auto create an image (gif format) from PDF files. (all the PDF files have just one page).

2. The conversion should start from an y point and end at y point (omit the header and footer).

3. Resize the the converted image to a fix given width and height.

I would be so happy to know this process can be done via php/jquery or anything else...
0
Refael
Asked:
Refael
  • 3
  • 3
  • 2
  • +1
2 Solutions
 
GaryCommented:
Do you have shell access as you will need to install a couple of things
http://www.webvamp.co.uk/blog/coding/how-to-create-pdf-preview-images-in-php/

While this only creates a full page image you could then crop so many pixels from the top and bottom.
There is no point digressing to the other questions unless you can get imagemagick and ghostscript installed.
0
 
Dan CraciunIT ConsultantCommented:
You can do 1 and 3 with php (or the scripting language of your choice) and ImageMagick.

I don't think you can do 2 on the same step as 1, but once you have your gif you can crop it using ImageMagick.

So yes, all the steps can be done using php and the ImageMagick library.

HTH,
Dan
0
 
RefaelAuthor Commented:
Hi Cathal, Dan Craciun

I have only the access to the FTP. Not sure i can get an access to the hosting for the shell.
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
GaryCommented:
If your host will not install them then you are out of luck, as its shared hosting they are unlikely to install anything but you can ask them. They may already have them on the server, imagemagick is common and it wouldn't be unusual to see it.
0
 
Dan CraciunIT ConsultantCommented:
Or, if it's a one time job, just download all your pdf's to your computer and use XAMPP/WAMP (I assume you use Windows) to use php locally.
0
 
RefaelAuthor Commented:
Oh... yes i can do it locally. i can download via FTP all the PDF files for each project then run the script locally on my mac. Can this script do all the steps (1-3)?. What should i download and how to run it? Can you please guide me?
0
 
Ray PaseurCommented:
Are you on Windows Hosting?
0
 
Dan CraciunIT ConsultantCommented:
If you can work locally on your mac you don't need php.

Install imagemagick as noted here: http://www.imagemagick.org/script/binary-releases.php#macosx

Install ghostscript either via brew or from here: http://pages.uoregon.edu/koch/
Ghostscript is needed to convert from pdf.

Then:
1: convert -density 100 -depth 8 xxx.pdf xxx.gif
2: convert xxx.gif -shave 0,<no of px> xxx_noheaders.gif
3. convert xxx_noheaders.gif -resize <no of px> xxx_small.gif

HTH,
Dan
0
 
RefaelAuthor Commented:
Hi Guys,
Thank you for your solutions. This is not a one time job. I need to do the the same for almost every project i get. Anyway i decided to continue doing it manually as i am not sure about the installation and the how-to's... and again i thank you.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
  • 3
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now