javascript - 如何在 PHP 中将 html 转换为带有图像和所有样式(css)的 word doc 文件?
问题描述
我已经经历了许多解决方案,无论我在 StackOverflow 和 Google 上都可以找到,但对我没有任何帮助文件甚至样式。
convertToWordDoc.php
<?php
header("Content-type: application/vnd.ms-word");
header("Content-Disposition: attachment;Filename=document_name.doc");
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Offer Letter</title>
</head>
<body>
<div style="padding: 0.01em 150px;">
<div style="display:flex !important;width:80%;margin-top:10px;">
<img src="./assets/offer_letter_data/amosta_logo.png" style="">
<div style="border-left:5px solid black;">Hello</div>
</div>
</div>
</body>
</html>
解决方案
推荐阅读
- r - 包包装“odbc”不适用于全局连接
- python-3.x - 列出具有相同宽度的值
- git - 远程 url 环境变量
- c# - Outlook.MailItem 自定义属性问题
- python - 如何在 python 中使用 selenium 从 RadioButtons 中进行选择?
- java - 合并两个 WebElements 列表
- dojo - 将 JSON 数据发送到我的自定义类中的方法
- typescript - TypeScript 中的抽象函数导致类型之间的不兼容
- arrays - 数值 Fortran 中的最佳 I/O 实践
- linker - 为 `.o` 文件中的所有文本代码符号添加前缀