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

627
Visualizações
How to display pdf in preview HTML and click button print without save file

I'm using javascript/JQuery and HTML to preview PDF in HTML format:

Javascript:

$("#print").click(function() {
    var checkedItems = AUIGrid.getCheckedRowItemsAll(listGrid);

    if(checkedItems.length <= 0) {
        Common.alert("<spring:message code='000076'/>");
        return false;
    }
    else if(checkedItems.length == 1 ) {
        var itm = checkedItems[0];
        $("#V_DELVRYNO").val(itm.delyno);
        Common.report("printForm");
        Common.popupDiv("/myPopUp.do");
    }
    else {
        var tmpno = checkedItems[0].delyno;
        var delbool = true;
        for (var i = 0 ; i < checkedItems.length ; i++ ){
            var itm = checkedItems[i];
            if (tmpno != itm.delyno){
                delbool = false;
                break;
            }
        }
        if (delbool) {
            $("#V_DELVRYNO").val(tmpno);
            Common.report("printForm");
            Common.popupDiv("/myPopUp.do");
        }
        else {
            Common.alert('<spring:message code="001255"/>');
            return false;
        }
     }
 });

HTML:

 <li><p class="btn_grid"><a id="print">Print Report</a></p></li>
 
 
 <form id="printForm" name="printForm">
       <input type="hidden" id="viewType" name="viewType" value="PDF" />
       <input type="hidden" id="V_DELVRYNO" name="V_DELVRYNO" value="" />
       <input type="hidden" id="reportFileName" name="reportFileName" value="/logistics/Delivery_Note_for_Gl.rpt" /><br />
 </form>

when I click print button, it seem incorrect, it download file and display popup as difference flow.. But as expect it will display PDF preview in popup and then i can click print this pdf..

Step 1: Click button 'Print', it appears popup preview of PDF

Step 2: And then, Crt + P to print (No need save file pdf)

How to fix the problem ? thank a lot

over 4 years ago · Santiago Trujillo
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