igobranco / PrintServer

Web Server that takes a screenshot of a Web site and returns the base64 image in JSON

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

#PrintServer A PhantomJS Web Server that takes a screenshot of a given URL and returns a JSON with the base64 of the screenshot that was taken.
This Web Server can be called when a user asks to print a Web page, followed by printing the screenshot image.

Note: you need to install PhantomJS version 1.98 or below

#Running PrintServer Web server Usage: phantomjs PrintServer.js < portnumber >

Example: phantomjs PrintServer.js 8181

#Requiring the JSON with the image in base64

Example: http://localhost:8181/?url=http://google.pt

Usage: http://localhost:/?url= < urlEncoded >
Expected Output: { "imgBase64": "the image in base64 ..."}

< urlEncoded > - The url to take a screenshot should be escaped using the javascript function encodeURIComponent

About

Web Server that takes a screenshot of a Web site and returns the base64 image in JSON


Languages

Language:JavaScript 100.0%