Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个 php 页面,它输出从数据库中检索到的 .odt 文件打印数据。我使用下面的方法来创建 .odt 文件:
header('Content-Type: application/vnd.oasis.opendocument.text');
我遇到的唯一问题是<img>标签。以下命令将被忽略,并且我的 .odt 文件中不会出现任何图片:
<img>
<img src="/path_to_images/my_image.png">
我尝试使用相对路径和绝对路径来指向图像。
uri2x 建议的答案效果很好。总之,完整的 URL 使图像可以出现在 .odt 文件中:
<img src="http://example.com/path/image.png">