0

Hi we are using below code for printing in IE browser

function ieExecWB( intOLEcmd, intOLEparam ) {

    try {
       // Create OLE Object
        var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH=0 HEIGHT=0 CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>';
        // Place Object on page
        document.body.insertAdjacentHTML('beforeEnd', WebBrowser);
        //to handle the runtime errors if printer is not connected
        oldHandler = window.onerror;
        // if intOLEparam is not defined, set it
        if ( ( ! intOLEparam ) || ( intOLEparam < 2 )  || ( intOLEparam > 2 ) )
        intOLEparam = 2;
        // Execute Object
        WebBrowser1.ExecWB(intOLEcmd, intOLEparam);
        // Destroy Object
        WebBrowser1.outerHTML = "";
        window.onerror = oldHandler;

    }catch(vException){
        return;
    }
}//end of ieExecWB()

window.parent.frames.item('frameLeft').document.close();  
window.parent.frames.item('frameLeft').focus();             
document.frmBD0103.hdnPrnCookie.value = "";                                                                        
ieExecWB(6,PRINT_WITHOUT_PROMPT);
window.parent.frames.item('frameLeft').document.open();
window.parent.frames.item('frameLeft').document.write("Left Frame.....");
window.parent.frames.item('frameLeft').document.close();

Now we are changing browser from IE to Edge and Chrome.

Could you please suggest best way to use above functionality in chrome and edge browser.

  • First off, I don't think that Java solutions would be all that helpful here. – Hovercraft Full Of Eels Jan 06 '22 at 03:14
  • What you want is to print webpage without headers and footers in Chrome or Edge, right? If this is the case, you can try to implement this requirement through CSS style, simply refer to [this answer](https://stackoverflow.com/questions/1960939/disabling-browser-print-options-headers-footers-margins-from-page#answer-2780518). – Xudong Peng Jan 10 '22 at 07:09

0 Answers0