0

I have been asked to write an ASPX page that takes a snapshot of itself, as rendered in the browser with CSS, including any text the user has typed into INPUT elements, and any images on the page, and then converts that image to a PDF. It doesn't seem possible. Is it possible?

Tim
  • 8,669
  • 31
  • 105
  • 183
  • 1
    Code behind? No. But...http://stackoverflow.com/questions/4912092/using-html5-canvas-javascript-to-take-screenshots And if you need some sample code of how to post the image back to the server https://github.com/ivoviz/feedback – Paul Abbott Aug 02 '16 at 22:24
  • 1
    There's obviously more than one way to skin a cat. I've done this kind of thing in the past (wasn't easy!) using a combination of the HtmlAgilityPack and wkhtmltopdf libraries. HtmlAgilityPack allows you to programmatically extract rendered html from a web page (including styles and image paths) as one large string. You can then pass this string to wkhtmltopdf which then converts the html into a pdf. There's apparently a decent .NET wrapper for wkhtmltopdf called Pechkin which is available on NuGet along with HtmlAgilityPack. Lots of research and coding ahead of you my friend! – Scotty Aug 03 '16 at 00:41

0 Answers0