Skip to content

Html2Canvas example please #1518

Closed
Closed

Description

@itg-assistant

Cristian Zerbinati asked 2018-04-28 10:49:01 UTC

Hi,

there is no documentation for Html2Canvas, please can you write an example? (vbnet I prefere ;-) )

thank you so much

Cristian

Activity

  1. itg-assistant commented on Jun 13, 2026

    @itg-assistant
    Author

    Luca answered 2018-04-30 18:37:32 UTC

    https://html2canvas.hertzen.com/

    How to use the Wisej is documented in the code, it's one call:

    Html2Canvas.Screenshot((image) => {

    ....

    });

    See the overloads for the additional options.

  2. itg-assistant commented on Jun 13, 2026

    @itg-assistant
    Author

    Cristian Zerbinati answered 2018-04-30 19:34:43 UTC

    Sorry Luca,

    I don't understand how use it, I have a test button with this code on Click

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click

    Html2Canvas.Html2Canvas.Screenshot(
    Sub(ByVal img As Image)
    PictureBox1.Image = img
    End Sub
    )

    End Sub

    but do nothing, If I put a breakpoint on row PictureBox, the visual studio don't break on it

    thanks

    Cristian

  3. itg-assistant commented on Jun 13, 2026

    @itg-assistant
    Author

    Luca answered 2018-05-01 00:07:58 UTC

    That's because you are probably using a browser that doesn't support something that html2canvas needs. Check with F12, my guess is that it's the promise construct that is not supported by IE10. Try with Chrome instead.

    You can also add a polyfill like this https://polyfill.io/v2/docs/ to Default.html.  I tried with IE10 and now it works. See the requirements at https://html2canvas.hertzen.com/documentation.

  4. itg-assistant commented on Jun 13, 2026

    @itg-assistant
    Author

    Cristian Zerbinati answered 2018-05-01 07:43:06 UTC

    Ok I'll try to add polyfill, but I use Firefox and Chrome. The demo on hertzen.com works, but not my code with wisej. I have try vbnet and c#

    Cristian

  5. itg-assistant commented on Jun 13, 2026

    @itg-assistant
    Author

    Cristian Zerbinati answered 2018-05-01 10:30:59 UTC

    I have insert Polyfill and update the JavaScript, now works with IE (11), Edge, and Chrome, but not with Firefox. But the demo con site https://html2canvas.hertzen.com/ works olso with Firefox

  6. itg-assistant commented on Jun 13, 2026

    @itg-assistant
    Author

    Cristian Zerbinati answered 2020-05-14 07:53:54 UTC

    Solved updating the javascript html2canvas.js of the extension

    bye

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    GeneralQuestions, how-tos and everything else.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions