Home > other >  How do I make an iframe show at 100%?
How do I make an iframe show at 100%?

Time:09-14

I am trying to follow along with enter image description here

What am I doing wrong?

CodePudding user response:

iframe height only allows height=pixels so 100%=minimum (default=150)

see enter image description here

 
But simplest is decide a desired height. Workarounds may not work well based on user settings enter image description here

CodePudding user response:

Probably just invalid or at least not well-formatted HTML string. I'd suggest using the XElement syntax to build the HTML output, it helps to write the tags and attributes correctly...

Dim pdfBytes = 'The PDF byte array...
Dim pdfBase64 = Convert.ToBase64String(pdfBytes)
Dim html =
    <html>
        <body>
            <iframe
                width="100%"
                height="100%"
                src=<%= String.Concat("data:application/pdf;base64,", pdfBase64) %>>
            </iframe>
        </body>
    </html>.ToString()

WebView21.NavigateToString(html)

SO73708467

Nice VB.NET feature.

CodePudding user response:

can you try height="auto"; what is your parent div's height?

  • Related