PDF file in a popup window in phonegap.
you can change as you want this is just sample.
You can use the solution I proposed above, except for the iframe's url.
You have to put:
...<iframe src='http://docs.google.com/gview?url=http://your_path/a_pdf_file.pdf&embedded=true'
Arie.
EDIT: Your should also make some changements regarding the position of the CLOSE button. Here's a working demo example:
<!DOCTYPE>
You have to put:
...<iframe src='http://docs.google.com/gview?url=http://your_path/a_pdf_file.pdf&embedded=true'
Arie.
EDIT: Your should also make some changements regarding the position of the CLOSE button. Here's a working demo example:
<!DOCTYPE>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="Content-Style-Type" content="text/css">
<meta http-equiv="Content-Script-Type" content="text/javascript">
<title>PDF predetemined size</title>
function pdf(div)
{close_div=div
document.getElementById(div).innerHTML="<div style='position: absolute; left: 100px; top: 70px; right: 100px; bottom: 100px; border: 1px solid black'><div style='position: relative; float: right; cursor: pointer; top: 30px;left:-17px; z-index:1000;background:white' onclick='document.getElementById(close_div).innerHTML=""'>CLOSE <\/div><iframe src='http://docs.google.com/gview?url=http://mesdomaines.nu/pdf/pdf1.pdf&embedded=true' style='position: absolute; width: 100%; height: 100%' frameborder='0'><\/iframe><\/div>"
}
</script>
</head>
<body><div>
<div id="some_div"></div>
<a href="javascript: void(0)" onclick="pdf('some_div')">include PDF</a><br>
</div></body>
</html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="Content-Style-Type" content="text/css">
<meta http-equiv="Content-Script-Type" content="text/javascript">
<title>PDF predetemined size</title>
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script src="http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.js"></script>
<script type="text/javascript">function pdf(div)
{close_div=div
document.getElementById(div).innerHTML="<div style='position: absolute; left: 100px; top: 70px; right: 100px; bottom: 100px; border: 1px solid black'><div style='position: relative; float: right; cursor: pointer; top: 30px;left:-17px; z-index:1000;background:white' onclick='document.getElementById(close_div).innerHTML=""'>CLOSE <\/div><iframe src='http://docs.google.com/gview?url=http://mesdomaines.nu/pdf/pdf1.pdf&embedded=true' style='position: absolute; width: 100%; height: 100%' frameborder='0'><\/iframe><\/div>"
}
</script>
</head>
<body><div>
<div id="some_div"></div>
<a href="javascript: void(0)" onclick="pdf('some_div')">include PDF</a><br>
</div></body>
</html>
No comments:
Post a Comment