PDF inside an HTML

cano63
cano63 used Ask the Experts™
on
Hi people i have this html page that call a pdf and insert it in the page. For some reason when i use firefox the pdf show very small
but in the internet explorer it open normal.

What could be the problem
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Page</title>
<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
-->
</style></head>

<body>
<object >
  <param name=quality value=high>
  <embed src="my.pdf" quality=high width="100%" height="100%"></embed>

</object>
</body>
</html>

Open in new window

Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Don't talk to me.
Commented:
Hi cano63,

Setting the height of the object to 100% will not work because it is taking it's height from the containers html and body.  To set a 100% height for a document, you need something like this:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style>
html {
	min-height: 100%;
	height: 100%
}
body {
	margin: 0;
	padding: 0;
	min-height: 100%;
	height: 100%
}
#content {
	background: #EEE;
	margin: auto;
	width: 95%;
	min-height: 100%;
	height: 100%;
}
</style>
</head>

<body>
<div id="content">
<object >
  <param name=quality value=high>
  <embed src="my.pdf" quality=high width="100%" height="100%"></embed>

</object>
</div>
</body>
</html>

Open in new window

Michel PlungjanIT Expert
Top Expert 2009

Commented:
Also the embed is inside an object that may or may not have a width and height

Author

Commented:
i was missing that thanks

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial