Home >Backend Development >PHP Tutorial >Are there any third-party tools for generating Word in code?

Are there any third-party tools for generating Word in code?

WBOY
WBOYOriginal
2016-09-23 03:30:09844browse

The business needs to generate a test paper.
The format is Word. It is available for users to download.
We currently have the question information. As follows

<code>{
    "question": "<p>问题:<img src='xxx.png'>已知 f(x)=x2+bx+c(b,c∈R)(1) 当 b=c 时若函数 f(x) 的图像与 x 轴有两个交点, 其坐标分别为 x1,x2, 求证 x1<-1 且 x2<-1?</p>",
    "answer": "答案:2",
 }</code>

Generate the following format

Are there any third-party tools for generating Word in code?

The question now is
1. Is there a convenient and fast third-party tool that can be used to generate Word?
2. After the data is inserted into Word, the html tags in the data need to be parsed. For example, there is an img image tag in it. It needs to be in Word Shown in.

Hereby seek everyone. Thank you!


Currently, I am using phpoffice, but the html tag inside does not seem to be parsed, so I write the html as a string

Currently, I have built a service myself. It can convert file formats
html->pdf (supports css)
pdf->docx (the style will not change. Perfect)
I will send the service address in two days. You can test it Down

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn