Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Auto create images from PDF

Posted on 2014-02-05
9
Medium Priority
?
263 Views
Last Modified: 2014-03-23
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
Comment
Question by:Refael
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 2
  • +1
9 Comments
 
LVL 58

Assisted Solution

by:Gary
Gary earned 800 total points
ID: 39836709
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
 
LVL 35

Expert Comment

by:Dan Craciun
ID: 39836722
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
 

Author Comment

by:Refael
ID: 39836751
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.

 
LVL 58

Expert Comment

by:Gary
ID: 39836772
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
 
LVL 35

Expert Comment

by:Dan Craciun
ID: 39836819
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
 

Author Comment

by:Refael
ID: 39836860
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
 
LVL 111

Expert Comment

by:Ray Paseur
ID: 39836962
Are you on Windows Hosting?
0
 
LVL 35

Accepted Solution

by:
Dan Craciun earned 1200 total points
ID: 39837026
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
 

Author Comment

by:Refael
ID: 39948937
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

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses how to create an extensible mechanism for linked drop downs.
Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question