将 HTML (tinyMCE) 转换为 WORD (.docx)
我已经成功地使用 https://github.com 生成了 .docx
文档/djpate/docxgen 但一旦我尝试包含 TinyMCE 文本,我就无法再打开该文档。 (无效字符)。
有没有办法在将 HTML 文本提供给 docxgen 之前对其进行转换以避免此类错误?
I've been successfully able to generate a .docx
document with https://github.com/djpate/docxgen but as soon as i try to include TinyMCE text, i no longer can open the document. (non valid char).
Is there a way to convert the HTML text before giving it to docxgen to avoid such error?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
最后,我用这个答案解决了创建一个文档(只需输出 html,Word 就会识别它):
Finally, I settled with this answer to create a doc (simply output html and Word will recognize it):
我决定使用该库的专业版 http://www.phpdocx.com/ 作为它简化了整个过程。我希望它能满足我的需求。
I've decided to go with the pro version of the library http://www.phpdocx.com/ as it simplifies the whole process. I hope it'll fill my needs.
另一个解决方案是使用最近发布的 http://htmltodocx.codeplex.com/ 。
然而,我尝试了一下,它弄乱了我的发票(假设我使用了不应该使用的桌子)
吉姆
Another solution is using http://htmltodocx.codeplex.com/ which just recently came out.
I, however, tried it and it messed up my invoice (granted I used tables where I shouldn't have)
Jim