11

For some security reasons, I would like to generate an image based on Google Calendar embed iframe, to be able to show it on a website who don't allow iframes.

Is there any php library to create an image from html?

The script have to be executable on a linux server.

3
  • 1
    See this q stackoverflow.com/questions/757675/… Commented Jul 15, 2011 at 5:25
  • Instead of downloading the Google Calendar HTML and somehow rendering an image of it, why don't you just put that HTML into your webpage (without an iframe, directly). Your script is a proxy. Commented Jul 15, 2011 at 5:25
  • Sparky: Thanks for that, I'll look this other question, didn't think to look for screenshot. Dan: I can only add html on the website, I don't have access to the php. I want more to generate an image trough a cron and link this image. Commented Jul 15, 2011 at 5:35

2 Answers 2

8

The library wkhtmltoimage works perfectly.

I have created a page to embed the google calendar (the url can't be reach directly).

I generate a picture from this page and I link this image on my profile on the website.

Thanks heaps for the comments.

Sign up to request clarification or add additional context in comments.

Comments

0

functions from the GD library to output an image of the current screen

<?php
//All of your normal code would go here
//But before exiting, grab a snapshot
$image = imagegrabscreen();
imagejpeg($image,"my_screenshot.jpeg");
imagedestroy($image);
?>

Or use

websnapr lets you capture screenshots of (almost) any web page. Allow your visitors to instantly visualize any web page before clicking. Increase site traffic, click-through rate and site stickiness.

1 Comment

imagegrabscreen needs a windows server to run and websnapr needs some javascript, I won't be able to use them

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.