Link to home
Start Free TrialLog in
Avatar of geohix
geohix

asked on

Need to hide Menu, Tool, and Address bar when opening pdf document in IFrame

Is there a way to hide the toolbar, menu bar, and address bar at the top of the page when opening a pdf document in a new window.  Or is there a way to prevent the user from printing the pdf from the menu or tool bar.  What is happening is the user are pressing the print button on the tool bar and they get a blank document, when they should instead be pressing the print button on the adobe tool bar.  I have the pdf's opening in an IFrame.

Thanks
Avatar of bitter_chicken
bitter_chicken
Flag of Australia image

hey geohix - not a prob with a bit of javascript

------------------------

<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Open New Window</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript" type="text/JavaScript">
<!--
function openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
//-->
</script>
</head>

<body>
<a href="#" onClick="openBrWindow('pdffile.pdf','pdffile','width=400,height=400')">open pdf doc</a>
</body>
</html>
In the example I posted, I didn't define any 'features' other than width or height, so the window lacks scrollbars, menubars, etc
this link (in place of the one in my previous example) would show the page with all the extras (for your reference)
<a href="#" onClick="openBrWindow('pdffile.pdf','pdffile','toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width=400,height=400')">open pdf doc</a>
how is that? 6 min response! lol
;-) hope it helped
hold on - why are you opening them in an IFrame?
Avatar of geohix
geohix

ASKER

Here is my main page that I call the link from

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html><!-- InstanceBegin template="/Templates/HR.dwt" codeOutsideHTMLIsLocked="false" -->
<!-- DW6 -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<!-- InstanceBeginEditable name="doctitle" -->
<title>Kenwal Steel Corporation Intranet</title>
<!-- InstanceEndEditable --><link rel="stylesheet" href="emx_nav_left.css" type="text/css">
<script type="text/javascript">
<!--
var time = 3000;
var numofitems = 9;

//menu constructor
function menu(allitems,thisitem,startstate){
  callname= "gl"+thisitem;
  divname="subglobal"+thisitem;  
  this.numberofmenuitems = 9;
  this.caller = document.getElementById(callname);
  this.thediv = document.getElementById(divname);
  this.thediv.style.visibility = startstate;
}

//menu methods
function ehandler(event,theobj){
  for (var i=1; i<= theobj.numberofmenuitems; i++){
    var shutdiv =eval( "menuitem"+i+".thediv");
    shutdiv.style.visibility="hidden";
  }
  theobj.thediv.style.visibility="visible";
}
                        
function closesubnav(event){
  if ((event.clientY <48)||(event.clientY > 107)){
    for (var i=1; i<= numofitems; i++){
      var shutdiv =eval('menuitem'+i+'.thediv');
      shutdiv.style.visibility='hidden';
    }
  }
}
// -->
</script>
<!-- InstanceBeginEditable name="head" --><!-- InstanceEndEditable -->
<style type="text/css">
<!--
.style1 {
      font-size: 24px;
      font-weight: bold;
}
-->
</style>
</head>
<body onmousemove="closesubnav(event);">
<div class="skipLinks">skip to: <a href="#content">page content</a> | <a href="pageNav">links on this page</a> | <a href="#globalNav">site navigation</a> | <a href="#siteInfo">footer (site information)</a> </div>
<div id="masthead">
  <h1 id="siteName">&nbsp;</h1>
  <div id="utility">
    <div align="right"><a href="Main.htm">Home</a>      <!--| <a href="#">Accounting</a> -->
      | <a href="hr_home.htm">Human Resources</a>      <!--| <a href="#">ISO</a>
       | <a href="#">Outside Sales</a> | <a href="#">Pickler</a> | <a href="#">Production</a> -->
      | <a href="http://fax/rightfax">Right Fax Login</a>      <!--| <a href="#">Quality Control</a>-->
       | <a href="Support_home.htm">Support</a>
    </div>
  </div>
  <div id="globalNav">
    <img alt="" src="gblnav_left.gif" height="32" width="4" id="gnl"> <img alt="" src="glbnav_right.gif" height="32" width="4" id="gnr">
    <div id="globalLink">
      <a href="hr_policy/policymanual.htm" id="gl1" class="glink" onmouseover="ehandler(event,menuitem1);">Policy and Procedures </a>
        <a href="#" id="gl2" class="glink" onmouseover="ehandler(event,menuitem2);">Forms
      </a><a href="#" id="gl3" class="glink" onmouseover="ehandler(event,menuitem3);">Insurance Info
      </a><a href="#" id="gl4" class="glink" onmouseover="ehandler(event,menuitem4);">Benefits
      </a><a href="#" id="gl5" class="glink" onmouseover="ehandler(event,menuitem5);">Databases</a>
        <a href="#" id="gl6" class="glink" onmouseover="ehandler(event,menuitem6);">
      </a><a href="#" id="gl7" class="glink" onmouseover="ehandler(event,menuitem7);">
      </a><a href="#" id="gl8" class="glink" onmouseover="ehandler(event,menuitem8);">
      </a><a href="#" id="gl9" class="glink" onmouseover="ehandler(event,menuitem9);">
      </a>  
    </div>
    <!--end globalLinks-->
    <form id="search" action="">
      <input name="searchFor" type="text" size="10">
      <a href="">search</a>
    </form>
  </div>
  <!-- end globalNav -->
  <div id="subglobal1" class="subglobalNav">
  <!--  <a href="#">Link</a> | <a href="#">Link</a> | <a href="#">Link
    </a> | <a href="#">Link</a> | <a href="#">Link </a> | <a href="#">Link
    </a> | <a href="#">Training</a> -->
      
  </div>
  <div id="subglobal2" class="subglobalNav">
   <a href="hr_forms/benefit_forms/benefit_main_form.htm">Benefit Forms</a> | <a href="hr_forms/payroll_forms/payroll_form_main.htm">Payroll Forms </a> | <a href="hr_forms/insurance_forms/insurance_form_main.htm">Insurance Forms</a>| <a href="hr_forms/misc_forms/misc_main.htm">Misc. Forms</a>    
  </div>
  <div id="subglobal3" class="subglobalNav">
    <a href="hr_insurance_info/major_medical_main.htm">Major Medical</a> | <a href="hr_insurance_info/Dental.htm">Dental</a> | <a href="hr_insurance_info/vision.htm">Vision</a>      | <a href="hr_insurance_info/disability_ins.htm">Disability & Life/ADD Insurance</a> | <a href="hr_insurance_info/supplemental_insurance.htm">Supplemental Insurance</a>  
  </div>
  <div id="subglobal4" class="subglobalNav">
    <a href="hr_benefit/supplier_discount.htm">Auto Supplier Discount</a> | <a href="hr_benefit/401k.htm"> 401K</a> | <a href="hr_benefit/pto.htm">Paid Time Off</a> | <a href="hr_benefit/edu_reim.htm">Education Reimbursement</a>
      | <a href="hr_benefit/bond.htm">Bonds</a> | <a href="hr_benefit/flexible_spending.htm">Flexible Spending</a>
  </div>
  <div id="subglobal5" class="subglobalNav">
    <a href="#">Training</a> | <a href="#">Report of Injury</a>  | <a href="#">Out of class</a>  
  </div>
  <div id="subglobal6" class="subglobalNav">
    <a href="#">Link</a> | <a href="#">Link</a>  
  </div>
  <div id="subglobal7" class="subglobalNav">
    <a href="#">subglobal7 link</a> | <a href="#">subglobal7 link</a> | <a href="#">subglobal7
    link</a> | <a href="#">subglobal7 link</a> | <a href="#">subglobal7 link</a> | <a href="#">subglobal7
    link</a> | <a href="#">subglobal7 link</a>
  </div>
  <div id="subglobal8" class="subglobalNav">
    <a href="#">subglobal8 link</a> | <a href="#">subglobal8 link</a> | <a href="#">subglobal8
    link</a> | <a href="#">subglobal8 link</a> | <a href="#">subglobal8 link</a> | <a href="#">subglobal8
    link</a> | <a href="#">subglobal8 link</a>
  </div>
  <div id="subglobal9" class="subglobalNav">
    <a href="#">subglobal9 link</a> | <a href="#">subglobal9 link</a> | <a href="#">subglobal9
    link</a> | <a href="#">subglobal9 link</a> | <a href="#">subglobal9 link</a> | <a href="#">subglobal9
    link</a> | <a href="#">subglobal9 link</a>
  </div>
 
<!-- end masthead -->

<div id="pagecell1">
  <!--pagecell1-->
  <img alt="" src="tl_curve_white.gif" height="6" width="6" id="tl"> <img alt="" src="tr_curve_white.gif" height="6" width="6" id="tr">
  <div id="breadCrumb">
  </div>
  <!-- InstanceBeginEditable name="Body" -->
  <div id="pageName">
    <h2>Human Resources </h2>
    <p>&nbsp;</p>
    <p>KENWAL STEEL CORP. is an employee-oriented organization, that emphasizes our people as the source of our strength. In keeping with that emphasis, we listen to you and try to balance your concerns against the business evnivronment in which all of us must compete.</p>
    <p>The Company's objective is to offer competitive pay and benefits; relate increases in pay to job performance; and profide a safe and healthful work environment </p>
    <h1 align="center"><a href="#">Upcoming Training</a></h1>
    <h1 align="center">&nbsp;</h1>
    <h1 align="center"><a href="#">Events</a></h1>
  </div>
  <!-- InstanceEndEditable -->
  <div id="siteInfo">
     <a href="About.htm">About Us</a> | <a href="#">Site
    Map</a> | <a href="#">Privacy Policy</a> | <a href="mailto: kd_network@kenwal.com">Contact Us</a> | &copy;2004
    Kenwal Steel Corp
  </div>
</div>
<!--end pagecell1-->
<br>
<script type="text/javascript">
    <!--
      var menuitem1 = new menu(9,1,"hidden");
                  var menuitem2 = new menu(9,2,"hidden");
                  var menuitem3 = new menu(9,3,"hidden");
                  var menuitem4 = new menu(9,4,"hidden");
                  var menuitem5 = new menu(9,5,"hidden");
                  var menuitem6 = new menu(9,6,"hidden");
                  var menuitem7 = new menu(9,7,"hidden");
                  var menuitem8 = new menu(9,8,"hidden");
                  var menuitem9 = new menu(9,9,"hidden");
    // -->
    </script>
</body>
<!-- InstanceEnd --></html>

The link that I am looking at in particular is called Policy and Procedures.  Looking at your response I mis-stated, I don't want to open in a new window, I want a particular page that has an pdf file in IFrame not to have the bars at the top or at minimum the print options...  Here is the page that I don't want the bars on...

It is all the same except in the body I have this command

 <!-- InstanceBeginEditable name="Body" -->
 
  <div id="pageName">
   <IFRAME SRC="dearpol.pdf" WIDTH="100%" HEIGHT="600"></IFRAME>

  </div>
ASKER CERTIFIED SOLUTION
Avatar of bitter_chicken
bitter_chicken
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of geohix

ASKER

Sorry, about the points... You are right, this was a lot more than I expected.  I am new to the forum (as if you couldn't tell) Is there a way to up the points?
yeah - there is a box to up the points, but i think that disappears once you've accepted an answer :(