lib/webpage.js
function (filename, callbackFn) {
                    var self = this,
                        url = self.options.hostAndPort + '/page/functions/render';

                    self.options.debug && console.log('calling url: %s', url);
                    request.post(url, {form:{ args:JSON.stringify(
                            [
                                filename
                            ], null, 4)}},
                        function (error, response, body) {
                            error && console.error(error);
                            if (response && response.statusCode === 200) {
                                callbackFn && callbackFn.call(self, !!body);
                            }
                            else {
                                console.error(body);
                                callbackFn && callbackFn.call(self, body);
                            }
                        }
                    );
                }
function (filename, callbackFn) {
                    var self = this,
                        url = self.options.hostAndPort + '/page/functions/render';

                    self.options.debug && console.log('calling url: %s', url);
                    request.post(url, {form:{ args:JSON.stringify(
                            [
                                filename
                            ], null, 4)}},
                        function (error, response, body) {
                            error && console.error(error);
                            if (response && response.statusCode === 200) {
                                callbackFn && callbackFn.call(self, !!body);
                            }
                            else {
                                console.error(body);
                                callbackFn && callbackFn.call(self, body);
                            }
                        }
                    );
                }
function ( filename , callbackFn ) { var self = this , url = self . options . hostAndPort + '/page/functions/render' ; self . options . debug && console . log ( 'calling url: %s' , url ) ; request . post ( url , { form : { args : JSON . stringify ( [ filename ] , null , 4 ) } } , function ( error , response , body ) { error && console . error ( error ) ; if ( response && response . statusCode === 200 ) { callbackFn && callbackFn . call ( self , ! ! body ) ; } else { console . error ( body ) ; callbackFn && callbackFn . call ( self , body ) ; } } ) ; }
Renders the web page to an image buffer and save it as the specified file. Currently the output format is automatically set based on the file extension. Supported formats are PNG, GIF, JPEG, and PDF.
Renders the web page to an image buffer and save it as the specified file . Currently the output format is automatically set based on the file extension . Supported formats are PNG GIF JPEG and PDF .