Take a full, scrolling screenshot of a Blazor Hybrid app

AdamMeaney-2379 0 Reputation points
2024-12-04T22:53:45.49+00:00

I am trying to find a way to take a screenshot of a Blazor Hybrid page that goes covers the area off screen as well.

I tried using html2canvas and was only able to get the current viewport.

I tried a DI injected native code that creates a bitmap from a webview, but was only able to get the visible display.

Has anyone got this working and has somewhere to point me to get the full, scrollable window?

Developer technologies | .NET | Blazor
Developer technologies | .NET | .NET MAUI
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Ria Kalachetty 0 Reputation points
    2024-12-05T01:30:33.19+00:00

    This might help - https://pptr.dev/

    0 comments No comments

  2. Bruce (SqlWork.com) 78,311 Reputation points Volunteer Moderator
    2024-12-05T02:22:37.0733333+00:00

    You need to turn scrolling (overflow) off when you call html2canvas, turn back on after. this will cause a flicker.

    a common browser approach is to have a print display popup. in Maui you do this by having the hosting app create a new webview, and passing markup to the new webview.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.