打开 pdf 时调整 iframe 大小
我有一个 iframe,我想从侧栏上的列表中打开 pdf 文件。
我一切正常,但 pdf 显示在 500 x 200 的小框中,并且不会“调整大小”,以便用户可以阅读整个页面。
实时网站位于此处 http://www.markonsolutions.com/opportunities.php
其背后的代码是
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!--
Design by Free CSS Templates
http://www.freecsstemplates.org
Released for free under a Creative Commons Attribution 2.5 License
-->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>MARKON, Inc. - Professional Services, Personal Solutions</title>
<meta name="keywords" content="" />
<meta name="description" content="" />
<link href="careers.css" rel="stylesheet" type="text/css" />
</head>
<body>
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-8011431-1");
pageTracker._trackPageview();
} catch(err) {}</script>
<div id="header"></div>
<div id="menu">
<ul>
<li><a href="index.html" accesskey="1">Home</a></li>
<li><a href="aboutus.html" accesskey="2">About Us</a></li>
<li><a href="capabilities.html" accesskey="3">Capabilities</a></li>
<li><a href="contracts.html" accesskey="4">Contracts</a></li>
<li><a href="careers.html" accesskey="5">Careers</a></li>
<li><a href="contactus.html" accesskey="6">Contact Us</a></li>
</ul>
</div>
<div id="content">
<div id="colOne">
<h2>Opportunities</h2>
<IFRAME SRC="newpage.html" width="100%" height="100%" id="iframe1" marginheight="0" frameborder="0" "></iframe>
</div>
<div id="colTwo">
<h2>Careers</h2>
<ul>
<li><a href="opportunities.html">Opportunities</a></li>
<li><a href="benefits.html">Benefits</a></li>
</ul>
<h2>Open Positions</h2>
<?php
$files = glob("./jobops/*.pdf");
sort($files);
//print("<br>"+count($files)+"<br>");
print("<ul>");
foreach ($files as &$file)
{
$Jobname =substr($file,0,strlen($file)-4);
$Jobname = str_replace("./jobops/","",$Jobname);
print("<li><a href=\"$file\" target=\"iframe1\">$Jobname</a></li>");
}
print("</ul>");
?>
</div>
<div style="clear: both;"> </div>
</div>
<div id="footer">
<p>Copyright © 2009 <a href="http://www.markonsolutions.com"><strong>MARKON, Inc.</strong></a></p>
</div>
</body>
</html>
I have a iframe that i want to open pdf's into from a list on the side bar.
I have everything working but the pdf shows up in a little 500 by 200 box on the and wont "resize" to so the user can read the entire page.
the live site is located here
http://www.markonsolutions.com/opportunities.php
and the code behind it is
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!--
Design by Free CSS Templates
http://www.freecsstemplates.org
Released for free under a Creative Commons Attribution 2.5 License
-->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>MARKON, Inc. - Professional Services, Personal Solutions</title>
<meta name="keywords" content="" />
<meta name="description" content="" />
<link href="careers.css" rel="stylesheet" type="text/css" />
</head>
<body>
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-8011431-1");
pageTracker._trackPageview();
} catch(err) {}</script>
<div id="header"></div>
<div id="menu">
<ul>
<li><a href="index.html" accesskey="1">Home</a></li>
<li><a href="aboutus.html" accesskey="2">About Us</a></li>
<li><a href="capabilities.html" accesskey="3">Capabilities</a></li>
<li><a href="contracts.html" accesskey="4">Contracts</a></li>
<li><a href="careers.html" accesskey="5">Careers</a></li>
<li><a href="contactus.html" accesskey="6">Contact Us</a></li>
</ul>
</div>
<div id="content">
<div id="colOne">
<h2>Opportunities</h2>
<IFRAME SRC="newpage.html" width="100%" height="100%" id="iframe1" marginheight="0" frameborder="0" "></iframe>
</div>
<div id="colTwo">
<h2>Careers</h2>
<ul>
<li><a href="opportunities.html">Opportunities</a></li>
<li><a href="benefits.html">Benefits</a></li>
</ul>
<h2>Open Positions</h2>
<?php
$files = glob("./jobops/*.pdf");
sort($files);
//print("<br>"+count($files)+"<br>");
print("<ul>");
foreach ($files as &$file)
{
$Jobname =substr($file,0,strlen($file)-4);
$Jobname = str_replace("./jobops/","",$Jobname);
print("<li><a href=\"$file\" target=\"iframe1\">$Jobname</a></li>");
}
print("</ul>");
?>
</div>
<div style="clear: both;"> </div>
</div>
<div id="footer">
<p>Copyright © 2009 <a href="http://www.markonsolutions.com"><strong>MARKON, Inc.</strong></a></p>
</div>
</body>
</html>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
显示在渲染页面中的代码将高度设置为 200px...
并且 newpage.html 的渲染代码包含一个关闭 div 标签,但不包含该 div 的开放标签。
你用什么来将 pdf 中的文本填充到 newpage 中?
the code that shows up in the rendered page is setting the height at 200px...
and the rendered code for newpage.html includes a close div tag but not an open tag for the div.
What are you using to populate the text from the pdf to newpage?
我上传了错误的版本!
I was uploading the wrong version!