Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Printing a PDF file instead of the IE window.

Status
Not open for further replies.

Jean01

Technical User
May 6, 2001
15
US
I need some help with this code...
I am trying to force the pdf file to print instead of the active Internet Explorer window.
<head>
<meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=iso-8859-1&quot;>
<meta name=&quot;GENERATOR&quot; content=&quot;Microsoft FrontPage 3.0&quot;>
<link rel=&quot;alternate&quot; media=&quot;print&quot; href=&quot;document_name.pdf&quot;>
<script language=&quot;Javascript&quot;>
<!--
function printpdf() {
browserVersion = parseInt ( navigator.appVersion)
if (browserVersion >= 4) window.print ()
}

// -->
</script>

<title>Title</title>
</head>

I have put an image on the page that looks like a printer and that should initiate the printing process.

The code behind the image looks like this:
href=&quot;javascript:printpdf ()&quot;><img src=&quot;../images/Pics/printr01.gif&quot;
alt=&quot;Print Adobe Acrobat version of this page&quot; style=&quot;border: medium none&quot; WIDTH=&quot;33&quot;
HEIGHT=&quot;29&quot;>

The only things that gets printed are the IE headers (containing the title of the html page + page numbering)and footers (containing the actual path of the PDF file + date), not the actual PDF file. Both HTML and PDF files are located in the same directory and the PDF file prints fine if I right-click on it and select &quot;print&quot; from the source directory.

Reading the FAQ and other threads leads me to believe that it should work!.

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top