|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Javascript print function
window.print() works fine when the information on my page is static text however on my page I have used the <embed> tag to embed a PDF file into the page and now the javascript print command wont work at all. Is it because the command is given before the file has time to load? How can I print the pdf in question by clicking a link???
Please assist. Code:
<html>
<head>
<title>Printing your £1000 cashback vourcher...</title>
<script language="javascript">
function printDoc(){
window.print();
}
</script>
</head>
<body onLoad="javascript:printDoc()">
<embed id="theFile" src="mypdf.pdf" width="100%" height="100%">
</body>
</html>
|
|
#2
|
||||
|
||||
|
have you tried just adding a button that calls windows.print()?
__________________
The liver is evil and must be punished! |
|
#3
|
|||
|
|||
|
Yeh theres that however the problem is different. What I really want it to open a pdf from a link which not only opens the pdf but prints it??? I've seen so many site which when you click a link and it takes you to another page a print dialog is opened ready for you to print. Does anyone have any clues what to do?
|
![]() |
| Viewing: Dev Shed Forums > Web Design > JavaScript Development > Javascript print function |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|