Skip to content
Web Server that takes a screenshot of a Web site and returns the base64 image in JSON
JavaScript
Tree: ad75975db2
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
PrintServer.js
README.md

README.md

#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

You can’t perform that action at this time.