Jump to content
Sign in to follow this  
penguine

How do i make entire browser output to image?

Recommended Posts

hi I mean there are lot of content on the browser window ,like w3schools page.I want to convert it in to a jpg or gif format using php or javascript .How should i accomplish this?

Share this post


Link to post
Share on other sites

You'll need to buy some software to do that, or write your own HTML rendering engine. You need to render the page and output the rendered code as an image. There's not a PHP command to render a page, PHP does not need an HTML rendering engine.

Share this post


Link to post
Share on other sites

If you want to automate this process by including it in a PHP script (no JavaScript way, sorry), you'll need to find an application that has either a PHP API, or at least a COM server.One application I know of that has a COM server is SnagIt, but I just tried using it, and failed miserably. I'm not sure if there's a bug in the COM server, or with PHP's handling of it (the code I have was just "$snagit = new COM('SnagIt.ImageCapture');" and the output - some werid text).If you can find any other screen capturing program that has a working COM API, please let us (or at least me) know.

Share this post


Link to post
Share on other sites
If you're seeing text it's probably a mime type issue, make sure the correct headers are being sent.
I'm only creating the COM component. Nothing more, and nothing less. The entire code I have is:
<?php$snagit = new COM('SnagIt.ImageCapture');?>

As you see, I never even echo anything. In addition, I tryed turning it into

<?php$snagit = new COM('SnagIt.ImageCapture');echo 'Yeah!';?>

Only to get a slightly longer werid text. Never in the source (especially never at the end) I saw "Yeah!". If it was a MIME type issue, I think I should have at least saw THAT. Besides, this is a COM constructor, not an image. It is supposed to return an object I can then set properties on, and initiate methods from.(My setup is Windows XP SP2 with all required and optional updates to date, Apache 2.2.8, PHP 5.2.4 and SnagIt 8.2.0)

Share this post


Link to post
Share on other sites

Yeah I'm not sure, I've never used SnagIt before. Surely something like this would be a FAQ or something.

Share this post


Link to post
Share on other sites
Yeah I'm not sure, I've never used SnagIt before. Surely something like this would be a FAQ or something.
Not in SnagIt's one, that's for certain. They never mention PHP at all. They show how to do things in C++/ATL, C#, VB, VB.NET and VBScript. Haven't tried using the COM API in those languages yet, but I have used PHP's COM class before (for other COM components), so I know that part should be OK.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...