Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
19 lines (12 sloc) 901 Bytes

#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.