【发布时间】:2011-01-26 10:14:22
【问题描述】:
现在,我一切都好。它根据我的 CSS (text-align: center;) 打印。
我唯一的问题是图像。这是 HTML 代码:
<table id="cert">
<td>
<tr><h1>Singapore Aviation Academy</h1></tr>
<tr><img src = "img/logo1.jpg" /></tr>
<tr><h2>Certificate of Completion </h2></tr>
<tr>is hereby granted to</tr>
<tr><?php echo "<b>".$row['fname']." ".$row['lname']."</b>"; ?> </tr>
<tr>to certify that he/she has completed to satisfaction for</tr>
<tr><?php echo "<b>".$row1['course_title']."</b>"; ?></tr>
</td>
</table>
紧接着:
<?php
//This php will enable documents to be embedded with Microsoft Word
header("Content-type: application/msword"); //Document will be embedded using the application, Microsoft Word
header("Content-disposition: attachment; filename= \"Certificate for ".$row['fname']." ".$row['lname']."\""); //States the file name when opened to edit or view
?>
问题在于<img> 标签。没有最后几行 PHP 代码,图像就会出现。有了它,图像就不会显示在 MS-Word 中了。
知道如何解决这个问题吗?
【问题讨论】:
-
每当我看到有人试图将 HTML 标记作为 MS Office 文档传递出去时,我都会感到畏缩,只是在更改标题
-
<img>标签与 MS Word 有什么关系? -
@Mark Baker:这是我看到的第一条领带,但我的一部分灵魂已经死了......
-
每当有人将 HTML 作为 MS Office 数据传递时,小猫都会发生这种情况:startrek.com/legacy_media/images/200506/ds9-437-arjin002/…
标签: php image ms-word content-type