We would like to show the document (e.g. pptx
, xlsx
, docx
, pdf
, html
) in a html page after retrieving it fro
Google docs viewer can handle this.
try
<html>
<head>
<style>
*{margin:0;padding:0}
html, body {height:100%;width:100%;overflow:hidden}
</style>
<meta charset="utf-8">
<?php
$url = $_GET['url'];
?>
<title><?php echo $url; ?></title>
</head>
<body>
<iframe src="http://docs.google.com/viewer?url=<?=urlencode($url)?>&embedded=true" style="position: absolute;width:100%; height: 100%;border: none;"></iframe>
</body>
</html>
Non-html content apart from images needs to be retrieved using an object, embed or iframe tag
<iframe src="somepage.pdf"></iframe>
<object src="somepage.pdf"><embed src="somepage.pdf"></embed></object>
somepage.pdf could be somepage.jsp?filename=somepage&mimetype=application/pdf
Here is an interesting link How to Embed Microsoft Office or PDF Documents in Web Pages
and here is a stackoverflow search
If you are looking for a pure HTML version of the document (for fast rendering and cross browser support), you can go through Docspad. Docspad helps embedding all the different popular document formats into your web application. http://docspad.com