0

How can I add watermarks on Phantomjs images?

Somewhat like this: enter image description here

Can page.evaluate help me here?

Any injection or while rendering should not affect the actual look of the webpage. This stamp should only overlay.

Artjom B.
  • 61,146
  • 24
  • 125
  • 222
Yogesh Unavane
  • 265
  • 3
  • 11

2 Answers2

5

The rendering is very high level in PhantomJS. The only way is to inject the watermark as an element (think position: absolute) into the DOM through page.evaluate and remove it after the screenshot.

Artjom B.
  • 61,146
  • 24
  • 125
  • 222
-1

Finally got it.

Created a new html element which is required, from DOM method and then injected this while rendering the HTML by page.evaluate.

Yogesh Unavane
  • 265
  • 3
  • 11
  • 2
    Your answer is basically saying the same thing as mine. Do you mind exanding with actual code to warrant the new answer? – Artjom B. Nov 20 '14 at 13:52