×

Loading...
Ad by
  • 最优利率和cashback可以申请特批,好信用好收入offer更好。请点链接扫码加微信咨询,Scotiabank -- Nick Zhang 6478812600。
Ad by
  • 最优利率和cashback可以申请特批,好信用好收入offer更好。请点链接扫码加微信咨询,Scotiabank -- Nick Zhang 6478812600。

repost my clarified question (javascript and pdf related)

本文发表在 rolia.net 枫下论坛Thanks in advance first.

Requirement:
I need to generate and print a summary pdf without refresh main html in windows xp sp2 IE.

Problem:
First, this case works on winxp, but need refresh main html which i dont want:
1. open a new html with following:
<object id="objPdf" classid="clsid:CA8A9780-280D-11CF-A24D-444553540000" style="height:500; width:750">
<param name="src" value="printABC.do"/>
</object>
2.Add a button, onclick="printPDF();"


Following doest work (but all just works on win2000):
case 1:
1.open a html:
<object id="objPdf" classid="clsid:CA8A9780-280D-11CF-A24D-444553540000" style="height:500; width:750">
</object>
<script>

function generateNprintPDF(){
var acrobat = document.applets["objPdf"];
acrobat.src="printABC.do"; //or .src='abc.pdf' as getting from local
acrobat.Print();
}
</script>


case2:
1. open a html with following:
<iframe id='abc' onload="printPDF()">
</iframe>
<input type="button" onclick="generatePDF();" value='print"/>
<script>
function generateNprintPDF(){
var ifr=document.getElementById('abc');
ifr.src='printpdf.html';
}
function printPDF(){
var acrobat = document.applets["objPdf"];
acrobat.Print();
}
</script>

2. printPDF.html:

<object id="objPdf" classid="clsid:CA8A9780-280D-11CF-A24D-444553540000" style="height:500; width:750">
<param name="src" value="abc.pdf"/>
</object>

case 3(this is a sick way, but still doest work):
1.MainHtml:
<iframe id='abc' onload="printPDF()">
</iframe>
<input type="button" onclick="generatePDF1()"/>
function generatePDF1(){
var ifr=document.getElementById('abc');
ifr.src='printpdf.html';

popupAwinAlsoWithPDF();
}
<input type="button" onclick="printPDF();"/>

function printPDF(){
var acrobat = document.applets["objPdf"];
acrobat.Print();
}更多精彩文章及讨论,请光临枫下论坛 rolia.net
Report

Replies, comments and Discussions:

  • 工作学习 / 专业技术讨论 / repost my clarified question (javascript and pdf related)
    本文发表在 rolia.net 枫下论坛Thanks in advance first.

    Requirement:
    I need to generate and print a summary pdf without refresh main html in windows xp sp2 IE.

    Problem:
    First, this case works on winxp, but need refresh main html which i dont want:
    1. open a new html with following:
    <object id="objPdf" classid="clsid:CA8A9780-280D-11CF-A24D-444553540000" style="height:500; width:750">
    <param name="src" value="printABC.do"/>
    </object>
    2.Add a button, onclick="printPDF();"


    Following doest work (but all just works on win2000):
    case 1:
    1.open a html:
    <object id="objPdf" classid="clsid:CA8A9780-280D-11CF-A24D-444553540000" style="height:500; width:750">
    </object>
    <script>

    function generateNprintPDF(){
    var acrobat = document.applets["objPdf"];
    acrobat.src="printABC.do"; //or .src='abc.pdf' as getting from local
    acrobat.Print();
    }
    </script>


    case2:
    1. open a html with following:
    <iframe id='abc' onload="printPDF()">
    </iframe>
    <input type="button" onclick="generatePDF();" value='print"/>
    <script>
    function generateNprintPDF(){
    var ifr=document.getElementById('abc');
    ifr.src='printpdf.html';
    }
    function printPDF(){
    var acrobat = document.applets["objPdf"];
    acrobat.Print();
    }
    </script>

    2. printPDF.html:

    <object id="objPdf" classid="clsid:CA8A9780-280D-11CF-A24D-444553540000" style="height:500; width:750">
    <param name="src" value="abc.pdf"/>
    </object>

    case 3(this is a sick way, but still doest work):
    1.MainHtml:
    <iframe id='abc' onload="printPDF()">
    </iframe>
    <input type="button" onclick="generatePDF1()"/>
    function generatePDF1(){
    var ifr=document.getElementById('abc');
    ifr.src='printpdf.html';

    popupAwinAlsoWithPDF();
    }
    <input type="button" onclick="printPDF();"/>

    function printPDF(){
    var acrobat = document.applets["objPdf"];
    acrobat.Print();
    }更多精彩文章及讨论,请光临枫下论坛 rolia.net
    • BTW, is there specific good javascript forums?