简体   繁体   中英

Generate Screenshots from URL using ASP.NET and C#

I want to generate screenshots of a website using its URL.

This I want to create using ASP.NET and C#, and I dont want to use any of the available tools and API(Url2Png, Wesnappr, Awesomium etc..).

Which classes of ASP.NET and C# should I explore for this ? How should I start about on this ?

Please can someone guide me on this.

Looks like fun project to do by hand...

  • Read W3C site for HTML and CSS specifications (4+5 for HTML and 1+2+3 for CSS)
  • Implement your own HTML engine
  • Read ECMA specification to learn inner workings of JavaScript. Also dont forget to check for specific implementations for most popular browser(s) for you.
  • Implement your own JavaScript engine
  • Tie HTML and JavaScript engines togehter

Now when you have a way to safely render HTML on server it is an easy task: Get your engines to render page into a bitmap (may also need to implement cutom grapics library) and you are done.

More seriously - use existing tools (make sure they are ok to be used on server - ie I would not do it with IE engine). Or if you want to learn some particular part of the stack - scope the rest down (ie just render title of the page to bitmap using System.Drawing) to see how components work together.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM