Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

183
Visualizações
Image is not appearing in the print preview chrome

While we want print the HTML page then image is not appearing in print preview, I tried with multiple area but not generate the outoput. Right Now in print preview it is not showing the correct one. It is very request everyone, Please help for this issue.

Input:

<?xml version="1.0" encoding="UTF-8"?>
<pat id="Main_Window">
    <title>Main Window</title>
    <body>
        <p>The main console screen includes nine panels or areas, which are shown and described below.</p>
        <p><image width="600" href="../MiVBC_Graphics1/MainWindow_CloudlinkChat.bmp" placement="break"/></p>
        <p>Content here</p>
        <p>Content here</p>
        <p>Content here</p>
        <p>Content here</p>
    </body>
</pat>

Java Script code:

function printIframe(url, height) {
                var heading_one = window.iframeHeight.heading
                var test = window.iframeHeight.maindivcontent
                console.log(test)
                console.log("fhghfjghdfjghfdg")
                var proxyIframe = document.createElement('iframe');
                var body = document.getElementsByTagName('body')[0];
                body.appendChild(proxyIframe);
                proxyIframe.style.width = '100%';
                proxyIframe.style.height = '100%';
                proxyIframe.style.display = 'none';
                var contentWindow = proxyIframe.contentWindow;
                contentWindow.document.open();
                var is_chrome = Boolean(contentWindow.chrome);
                contentWindow.document.write(test)
                contentWindow.document.write('<iframe onload="print();" frameborder="0" marginheight="0" marginwidth="0"></iframe>');
                contentWindow.document.close(); 
                if (is_chrome) {
                    contentWindow.onload = function() { 
                    };
                }
                else {contentWindow.document.write('<iframe onload="print();" frameborder="0" marginheight="0" marginwidth="0"></iframe>');
    contentWindow.document.close(); }return true;}
about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

Does it still show up for you outside of print mode? Because when I test your code it doesn't. However, it works when you change the img href to src:

<p><image width="600" src="../MiVBC_Graphics1/MainWindow_CloudlinkChat.bmp" placement="break"/></p>

about 4 years ago · Juan Pablo Isaza Relatório

0

You need to set a timeout to give the browser some time to render the images. Try this:

setTimeout(function() {
    contentWindow.print();
    contentWindow.close();
}, 250);

And you also need to used src instead of href

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda