It is not working that way, As I need to the same from service. All you have provided me in the same is doable from Client side. I did check the link you have provided before I post my question.

I have a Generic page which takes page URL as a parameter and produce the pdf.
I will call the Generate PDF method from a page where there is no client side coding is not possible.