[Last Call] Learn how to a build a cloud-first strategyRegister Now

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

Create JPG from html

Hi,
I am after a script that will convert a webpage into a jpg.  I need it to be an online script, preferably to be run by PHP, and write the file to a directory.
If some one could give a specific and detailed way how i would be most appreciative!

Many thanks!
Pauliostro
0
Pauliostro
Asked:
Pauliostro
  • 3
  • 2
  • 2
  • +3
1 Solution
 
aplimediaCommented:
Not sure you will be able to do that. The fact is that the JPG is created from the Browser, like a screen shot. The server serves code to a browser which then displays the data as a web page. There is no browser on the server... the JPG you get is a function - plugin -program which runs clientside... on the users machine, and the not the server.

Aplimedia
0
 
PauliostroAuthor Commented:
would a cron job help?.. some how??
0
 
UnexplainedWaysCommented:
http://andy.5263.org/screengrab/

Or you can go to the FF Extentions and look for it on there website.  However reading there webpage it likes older versions of FF (pre 2 release).

0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
eheimerCommented:
I was able to find this Perl script for free: http://user.it.uu.se/~jan/html2ps.html which converts html to Postscript.

There is also this: http://www.guangmingsoft.net/htmlsnapshot/html2image.htm which converts html to bmp, png, and jpg.  It is free to try, $300 to buy.

The second one might be your beswt bet.  It looks like the first one would require a second step to convert the ps into jpg.
0
 
aescntCommented:
This may or may not be what you need: maybe you can try services like webshotspro.com or websitescreenshots.com.
0
 
InfoStrangerCommented:
Here is the codes for converting a file or url to jpg.

http://www.php.net/manual/en/function.imagecreatefromjpeg.php

When running the code, you need to following enclosed in <?php    ?>.
LoadJpeg(\...\???.html)
LoadJpeg(http://.../???.html)

Or something to that nature.  I don't know what you are converting.
0
 
eheimerCommented:
InfoStranger,

imagecreatefromjpeg creates an image from another image.  Although the documentation says "imagecreatefromjpeg -- Create a new image from file or URL", the URL must point to a jpg file, not an html document.
0
 
InfoStrangerCommented:
Ooops...  Thanks.   It was pretty late.
0
 
eheimerCommented:
Well, I'll plead my case for the sole recipient (no offense to the other experts).  The question clearly asked for a script such as PHP which is presumeably to be run server-side.  My answer is the only one that conformed to that requirement.
0
 
aescntCommented:
I've no objections to eheimer's plea. InfoStranger's suggestion was off (it was about loading a jpeg file for use in PHP), UnexplainedWays's suggestion was a Firefox extension, and mine was admitedly not a solution but more of a tip.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

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