Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

626
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!