How to save as image from a web page

I used flot to create a graph and I would like to be able to save/export the graph as an image. In firefox on windows you can just ctl rt-click and you have a save as image feature (which I can automate with js) but...I need this to work on a linux browser. On linux in firefox I can print preview and I see the graph there so, I know that it is possible but I just don't know how to do it.

Bottom line...I need to save an API chart generated on the web as an image (on a linux machine). It is not a standard image format.

Someone else suggested using canvas2image but I don't know how to implement it. My last resort will be a window capture using ImageMagic.

If anyone has some helpful suggestions, I would love to hear about it.:confused:

If im understanding you correctly, you just want to automate getting an image from a website?

On linux use a command:

wget http://www.somedomain.com/someimge.jpg -O /path/to/save/to/simeimage.jpg

Put it in crontab.

It is not that easy. It is not a standard image image...it is a graph that is created using an application.

You can see an example of a flot graph at people.iola.dk/olau/flot/examples/zooming.html

Ok, got ya.

There are plugins for firefox so save a webpage as an image.

try here: Search results for "save\ website\ to\ image" – Add-ons for Firefox (en-US)

Well I could use image capture software, but that means if someone happens to have another window open on top of the window that will be automatically captured then the overlapping window will be captured too...that's why I mentioned that I wanted to use ImageMagik as a last resort (it is also an image capture program). Thank you for your suggestions.

On of the plugins available for firefox can be ran from the command line, I dont remember which plugin it is, its on my computer at home. Then you dont have to worry about that. Just call firefox from command line with the plugin.

If you could find the name of that software that you use, please let me know. I would like to look into it. Right now I run ImageMagik from command line which is nice, but I still get overlap if another window is overlapping the specified window.

I think that Firefox 3 might have the "save image" ctl rt-click feature on linux but I can't seem to install it on my version of linux (I don't have permission to update it). If you run Firefox 3 on linux, do you get the "save image" option?

It's not even that it's not a standard image format -- it's that its calculated and rendered by javascript on load time! Imagemagick won't be able to touch that. Screen capture would work but would be annoying to automate. You'd almost do better to extract the equations and render it yourself...

Well, this might be out there but what I was hoping to do with the image-capture (using imagemagik) is have a remote user create the graph client side. Then if they want to save the graph, they click a button which sends the information back to the server and runs a script that launches a web browser and goes to a url that reads in the saved data. Then the imagemagik window capture will execute to output an image of the graph, which the user can then download...this is why I was saving it for last resort. Is it possible to take a screen shot of a window on a remote server?

Hm. At that point, the client will already have the data. When you right-click on the image and select 'view image' you will find the web browser interprets it as a data:// URL -- the image entire is encoded in the URL itself. If you can extract that URL, or at least copy/paste it, you've got the image.

Never mind. The data:// URL is just a blank white 300x500px image.

Perhaps you can get xsnap working. I've posted a generic x86 version here, converted to tar.gz from an rpm. You don't need to actually install it to use it, just extract it somewhere and run the xsnap binary in it, it'll let you draw a square on the screen, which'll then pop up as a new window. right-click on the new window and it'll let you save it as png.