Displaying a Microsoft Word Document in a web page.
Posted: Sun Sep 26, 2010 12:20 am
I can get the Microsoft Word document to display on our web page, but it does not display cleanly and has all the formatting characters scattered across the screen. Is there a way to filter the document so the formating is applied and the document appears cleanly? If not, is there a way to do that with a PDF file? Here is the code we are using:
Code: Select all
<html>
<head>
<title>Open Document</title>
</head>
<body>
<DIV align="CENTER">
<?php
$Text='';
$Article=trim($_GET['file']);
if($Article != '')
{ $Text=file_get_contents($Article);
echo $Text;
}
echo '<table BORDER="1" CELLSPACING="1" CELLPADDING="1" WIDTH="100%"><tr>';
echo '<TD WIDTH="10%" ALIGN="left" VALIGN="TOP">';
echo '<a href="doc.php?file=C:\myfiles\Cancer Part 2.doc" target=docwindow>Cancer Part 2</A><br>';
echo '<a href="doc.php?file=C:\myfiles\Cancer Part 2.doc" target=docwindow>Cancer Part 2</A><br>';
echo '<a href="doc.php?file=C:\myfiles\Cancer Part 3.doc" target=docwindow>Cancer Part 3</A>';
echo '<TD WIDTH="75%" ALIGN="CENTER" VALIGN="TOP">';
echo '<iframe name="docwindow" frameborder=6 width=800 height=600></iframe>';
echo '</CENTER></TD></TR></TABLE>';
?>
</DIV>
</body>
</html>