Printing a large PDF document that is added by EMBED tag
- 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.
var x = document.getElementById("PDF");
<body leftmargin=0 topmargin=0 rightmargin=0 bottommargin=0
onLoad="setTimeout('printNow();', 1000)" >
var myString ="<%=request.getContextPath()%>" +
document.write('<EMBED name="PDF" SRC="' + myString + '"
Here if I increase the setTimeOut period for the larger report then
print dialogs shows up. However, I do not know the size of the PDFs
I cannot decide the time at design time. Is there a way to findout
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.