Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

305
Vistas
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 la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda