douchen2011 2012-04-13 09:02
浏览 345
已采纳

Word XML到HTML(带样式)

I have a word template (msword 2010) that I inject variables into using PHPWord, and would like to convert that into a PDF.

My thought process is to convert the word document into xml (which I have done), then turn that xml into styled html.

So far I have managed to replace the xml elements that represent line breaks and paragraphs, but am wondering if there is some code somewhere that will convert the other xml elements into styled html. I know it is unlikely to be perfect, but something close would be good.

  • 写回答

1条回答 默认 最新

  • dongye9182 2012-04-13 09:06
    关注

    Your best bet is to use XSLT. There are some good tutorials on the web. This page gives the code for doing this in PHP.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 对于相关问题的求解与代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料