render - wkhtmltopdf 和 MathJax : equations are rendered too small

标签 render wkhtmltopdf mathjax wkhtmltoimage wkhtmltopdf-binary

我正在尝试使用 wkhtmltopdf 下载费曼讲座。这是我使用的命令行:

wkhtmltopdf.exe http://www.feynmanlectures.caltech.edu/I_44.html --javascript-delay 20000 --no-stop-slow-scripts ./out/I_44.pdf

然而,MathJAX 公式呈现得太小。这是一张图片: enter image description here

如何放大渲染的方程?

this topic建议的解决方案(据我了解)是添加

MathJax.Hub.Config({
CommonHTML: {
    minScaleAdjust: 100,
}
});

到 HTML。

但是,当然,下载 HTML 文件并在将其传递给 wkhtmltopdf 之前对其进行修改会太麻烦。如果可能的话,我更喜欢更简单的解决方案。

最佳答案

尝试使用

wkhtmltopdf.exe http://www.feynmanlectures.caltech.edu/I_44.html --run-script 'MathJax.Hub.Config({"HTML-CSS": {scale: 200}}); MathJax.Hub.Queue(["Rerender", MathJax.Hub], function () {window.status="finished"})' --window-status finished --no-stop-slow-scripts ./out/I_44.pdf

这将设置数学的缩放因子并以该大小重新渲染它。它还使用 window.status 变量将页面捕获与 MathJax 同步,以便在 MathJax 完成后立即进行捕获(而不是等待任意延迟)。

关于render - wkhtmltopdf 和 MathJax : equations are rendered too small,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51479907/

相关文章:

shiny - 如何在 Shiny 的情况下禁用右键单击 mathjax

javascript - 我如何在 reactjs 中渲染一个对象

PHP WkHtmlToPdf 无法添加多个页面

php - wkhtmltopdf 在通过 PHP 执行时卡在 10%,但通过命令行成功运行

python - PDF 打印受密码保护的页面(最好让 wkhtmltopdf 使用 cookie)

latex - Blogspot Latex 方程

javascript - 子组件中的 onClick 操作发送了错误的元素

html - angular 2 [innerHTML] 在 html 中渲染(不适用于 angular 2)

c++ - SDL不绘制图像

android - 如何在 android 布局中使用多个 MathJax 公式 View