469,282 Members | 2,301 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,282 developers. It's quick & easy.

Printing a large PDF document that is added by EMBED tag

Raj
Hi,
I have the following problem. I am displaying and printing a PDF file
that is generated by my Application server. The print dialogs comes up
correctly for the small PDF for the larger PDFs ,the print dialog for
the Acrobat reader does not comes up. I believe this is because print
method is called before the complete loading of the PDF document.

<html>
<Head>
<script>
function printNow()
var x = document.getElementById("PDF");
x.click();
x.setActive();
x.focus();
x.print();
</script>
</head>
<body leftmargin=0 topmargin=0 rightmargin=0 bottommargin=0
onLoad="setTimeout('printNow();', 1000)" >
<script language="javascript" >
var myString ="<%=request.getContextPath()%>" +
window.location.search.substring(1);
document.write('<EMBED name="PDF" SRC="' + myString + '" WIDTH=100%
HEIGHT=100% fullscreen="yes">');
</script>
</body>
</html>

Here if I increase the setTimeOut period for the larger report then the
print dialogs shows up. However, I do not know the size of the PDFs so
I cannot decide the time at design time. Is there a way to findout the
loading of the PDF document is complete.

So far , i have tried the following
1. Instead of onLoad, I tried calling the printNow() function in the
body after the EMBED. That does not help
2. Tried using the windows.document.pdf.ReadyStatus. It returns
complete even before complete document is loaded.

Any help is very much appreciated.

Thank you.
Raj

Feb 28 '06 #1
1 3404
Hi Raj,

I am also facing the same issue. Did you find out a work around for
this? If yes, could you please share it to us.

Thank you,
Chinna

Mar 20 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by Kerri McDonald | last post: by
1 post views Thread by Raju Joseph | last post: by
5 posts views Thread by Stefania Scott | last post: by
7 posts views Thread by Dennis C. Drumm | last post: by
2 posts views Thread by orekin | last post: by
4 posts views Thread by vunet.us | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.