English 中文(简体)
可靠地使人民抵抗力量在装上网页时打开印刷方言
原标题:Reliably render a PDF which opens a print dialog when loaded on a web page

我有一个网页(SSL),其中包含一个几乎看得见的仪表,其来源是来自 Java服务器的PDF。 光看透镜的目的是使人民抵抗力量在装满该页时打开打印方言箱。

这一进程是零星的。 更经常的是,当该网页装上时,国防军的印刷方言箱就会正确打开。 然而,有时,当页数时,人民抵抗力量的印刷方言箱就永远不会落空。 我知道,这在 Java关口不是一个问题,因为我可以从记录中核实,人民抵抗力量被正确地排到呼页。 我需要找到一种办法,使这一比率达到99.99.%,只要有可能,当页装满时,人民抵抗力量的印刷方言就会打开。 因此,我期待着就如何确保做到这一点提出任何建议。

This needs to work for Internet Explorer (version 8 in particular).

这就是 Java的基文,该页上载有“人民抵抗力量”的一环:

function openPrintCheckWindow(){
    pc=window.open("/print_check.jsp", "pc", "toolbar=no,scrollbars=no,resizable=no");
    pc.resizeTo(1000,700);
    pc.moveTo(80,80);
}

The sources for the page which contained the PDF iframe:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
    <TITLE></TITLE>

    <style> 
    #createpdf {
        position:absolute;
        top:0; 
        right:0; 
    }
    .micr {
        font-family: "MICR Encoding", sans-serif;
        font-size: 0.2in;
    }
    </style>

    <script type="text/javascript"> 
    function doAlert(msg){
    if(msg.length>0){
        alert(msg);
    }
    }

    //doesn t block the load event
    function createIframe(){
        var i = document.createElement("iframe");
        i.src = "/PrintCheckServlet";
        i.width = "2px";
        i.height = "2px";
        document.getElementById("createpdf").appendChild(i);
    };

    // Check for browser support of event handling capability
    if (window.addEventListener)
        window.addEventListener("load", createIframe, false);
    else if (window.attachEvent)
        window.attachEvent("onload", createIframe);
    else 
        window.onload = createIframe;
    </script>

</HEAD>

<BODY BGCOLOR="#DFD9D0" TEXT="#000066" onLoad="doAlert(  )">
    <FORM METHOD="POST" TARGET="main_window" ACTION="ControllerServlet">            
    <P ALIGN="LEFT">
        <INPUT TYPE="BUTTON" NAME="CLOSE" VALUE="Close" 
         onClick="this.form.submit();window.close();window.opener.focus();window=null;">
        <br />
        <H3 id="print_message">A print dialog box will show momentarily</H3>
    </P>
    <div id="createpdf"></div>
    </FORM>
</BODY>
</HTML>
最佳回答

你们是否认为,谁看待你的档案是使用Abbat Reader或“javascript-enabled”PDF阅读器?

如果是这样的话,你可以修改你的档案和.generate a PDF that autotexts.

问题回答

暂无回答




相关问题
selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

How to fire event handlers on the link using javascript

I would like to click a link in my page using javascript. I would like to Fire event handlers on the link without navigating. How can this be done? This has to work both in firefox and Internet ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Clipboard access using Javascript - sans Flash?

Is there a reliable way to access the client machine s clipboard using Javascript? I continue to run into permissions issues when attempting to do this. How does Google Docs do this? Do they use ...

javascript debugging question

I have a large javascript which I didn t write but I need to use it and I m slowely going trough it trying to figure out what does it do and how, I m using alert to print out what it does but now I ...

Parsing date like twitter

I ve made a little forum and I want parse the date on newest posts like twitter, you know "posted 40 minutes ago ","posted 1 hour ago"... What s the best way ? Thanx.

热门标签