简体   繁体   English

MathJax html渲染为pdf

[英]MathJax html render to pdf

I am trying to make an online quiz application where the user will be presented with a quiz that contains text, images and math equations. 我正在尝试制作一个在线测验应用程序,向用户呈现包含文本,图像和数学方程式的测验。 I also want the user to be able to print that quiz. 我还希望用户能够打印该测验。 I am using MathJax to display the equations. 我正在使用MathJax来显示方程式。

If the quiz contains just text and images but no math equations, I can use DomPdf to convert the quiz HTML to a PDF and have the user print it. 如果测验只包含文本和图像但没有数学方程,我可以使用DomPdf将测验HTML转换为PDF并让用户打印它。

However, how can I go about creating a PDF that has both the content from the HTML tags in the quiz and the math equations from the quiz rendered by MathJax? 但是,如何创建一个PDF,其中包含测验中HTML标签的内容和MathJax呈现的测验中的数学公式?

According to this post: http://sourceforge.net/projects/mathjax/forums/forum/948700/topic/3819537 wkhtmltopdf can convert the mathjax if you force a delay on the javascript rendering. 根据这篇文章: http//sourceforge.net/projects/mathjax/forums/forum/948700/topic/3819537 wkhtmltopdf可以转换mathjax,如果你强制延迟javascript渲染。 I just got finished talking to a guy here: Printing the current page to pdf using wkhtmltopdf about how to get a page saved to pdf using wkhtmltopdf from php. 我刚刚和这里的一个人谈完了: 使用wkhtmltopdf打印当前页面到pdf,关于如何使用wkhtmltopdf从php保存页面到pdf。 If you put those two things together, I think you can get what you want. 如果你将这两件事放在一起,我想你可以得到你想要的东西。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM