Solved

Create JPG from html

Posted on 2006-11-12
13
3,130 Views
Last Modified: 2008-01-09
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
Comment
Question by:Pauliostro
[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
  • 2
  • 2
  • +3
13 Comments
 
LVL 10

Expert Comment

by:aplimedia
ID: 17924840
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
 

Author Comment

by:Pauliostro
ID: 17924854
would a cron job help?.. some how??
0
 
LVL 12

Expert Comment

by:UnexplainedWays
ID: 17924952
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
Industry Leaders: 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!

 
LVL 2

Accepted Solution

by:
eheimer earned 500 total points
ID: 17924966
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
 
LVL 6

Expert Comment

by:aescnt
ID: 17925573
This may or may not be what you need: maybe you can try services like webshotspro.com or websitescreenshots.com.
0
 
LVL 3

Expert Comment

by:InfoStranger
ID: 17928366
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
 
LVL 2

Expert Comment

by:eheimer
ID: 17933691
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
 
LVL 3

Expert Comment

by:InfoStranger
ID: 17934558
Ooops...  Thanks.   It was pretty late.
0
 
LVL 2

Expert Comment

by:eheimer
ID: 18155896
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
 
LVL 6

Expert Comment

by:aescnt
ID: 18156407
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

Guide to Performance: Optimization & Monitoring

Nowadays, monitoring is a mixture of tools, systems, and codes—making it a very complex process. And with this complexity, comes variables for failure. Get DZone’s new Guide to Performance to learn how to proactively find these variables and solve them before a disruption occurs.

Question has a verified solution.

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

Suggested Solutions

"In order to have an organized way for empathy mapping, we rely on a psychological model and trying to model it in a simple way, so we will split the board to three section for each persona and a scenario and try to see what those personas would Do,…
An enjoyable and seamless user experience can go a long way on an eCommerce site. While a cohesive layout and engaging copy play roles in creating a positive user experience, some sites neglect aspects that seem marginal but in actuality prove very …
This tutorial demonstrates how to identify and create boundary or building outlines in Google Maps. In this example, I outline the boundaries of an enclosed skatepark within a community park.  Login to your Google Account, then  Google for "Google M…
The viewer will learn how to count occurrences of each item in an array.

726 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