I need help, I have a .PDF document and when a user clicks the link, I want it to open in the same window, not a new browser window, it shouldn't use the whole browser window, only specific width and height. Anyone know a code or something... Appreciate it ! \eonelite
It would be something like bellow: <iframe id="myFrame" style="display:none" width="500" height="300"></iframe> <input type="button" value="Open PDF" onclick = "openPdf()"/> <script type="text/javascript"> function openPdf() { var omyFrame = document.getElementById("myFrame"); omyFrame.style.display="block"; omyFrame.src = "myFile.pdf"; } </script> PHP:
Just make sure there's an option to download the PDF instead of forcing the crappy browser UI to try and get around it. There's a REASON I disable the PDF plugin for browsers as PDF's opening in a browser just pisses me off as a user. That said, sounds like you want an OBJECT tag, or if you give a flying purple fish about "standards" use an iframe.