Rendering HTML+Javascript server-side

前端 未结 4 556
礼貌的吻别
礼貌的吻别 2020-12-09 23:12

I need to render an HTML page server-side and \"extract\" the raw bytes of a canvas element so I can save it to a PNG. Problem is, the canvas element is created from javascr

4条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-09 23:27

    Basically you are trying to do things, which are not intended to be done in that way.

    You generate HTML + Javascript to enable the browser to draw it. You write C# to enable any kind of server side things.

    Generating HTML + Javascript on server to load it into a browser on server to be able to save PNG sounds bad.

    Did you think about other approaches like generating the image using server side C# component? Basically, why do you really need to save it on server? Maybe somebody can provide better solution?

提交回复
热议问题