X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=vendor%2Fjcalderonzumba%2Fgastonjs%2Fdocs%2Fapi%2Fcommands%2Frender%2Frender_base64.md;fp=vendor%2Fjcalderonzumba%2Fgastonjs%2Fdocs%2Fapi%2Fcommands%2Frender%2Frender_base64.md;h=fe87990c3ea8f84ca30665f57c7b857ef04102b1;hp=0000000000000000000000000000000000000000;hb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;hpb=57c063afa3f66b07c4bbddc2d6129a96d90f0aad diff --git a/vendor/jcalderonzumba/gastonjs/docs/api/commands/render/render_base64.md b/vendor/jcalderonzumba/gastonjs/docs/api/commands/render/render_base64.md new file mode 100644 index 000000000..fe87990c3 --- /dev/null +++ b/vendor/jcalderonzumba/gastonjs/docs/api/commands/render/render_base64.md @@ -0,0 +1,44 @@ +render_base64 +============= +This command allows you render a web page to an image buffer and returns the base64 encoded representation of the image. + +The supported formats are: + +* PNG +* GIF +* JPEG + +##Commmand arguments: + 1. image_format + 2. full + * `true` for rendering all the page, `false` if we are going to use a selection + 3. selector + * If full is `false` then you have to specify the CSS selection you want to render, internally we will use document.querySelector. + +##Full page render request: +```json +{ + "name" : "render_base64", + "args": [ + "png", true, null + ] +} +``` +##Part of a page render request: +```json +{ + "name" : "render_base64", + "args": [ + "png", false, "body > div.wrapper > div.main.clearfix" + ] +} + +``` + +##Response: +A successful render_base64 command will reply with: +```json +{ + "response": "iVBORw0KGgoAAAANSUhEUgAABAAAAACYCAYAAAB6Z5u+AAAABHNCSVQICAgIfAh......" +} +```