【发布时间】:2018-11-06 22:13:23
【问题描述】:
我的 Html 页面包含表格和 OpenLayers 地图
在所有浏览器甚至 IE 上一切正常。
我想将此页面转换为 pdf,所以我使用 wkhtmltopdf 并在阅读 wkhtmltopdf 时使用幕后 WebKit 来呈现页面,因此我在 Qt Web Browser 上测试输出,浏览器拒绝显示 OpenLayers 地图由于错误
ol-debug.js:18601ReferenceError: Can't find variable: requestAnimationFrame
ol.PluggableMap.prototype.render = function() {
if (this.animationDelayKey_ === undefined) {
this.animationDelayKey_ = requestAnimationFrame(
this.animationDelay_);
}
};
因为这个错误wkhtmltopdf只转换了Html表而忽略了地图
Ps:我使用这些命令进行转换
wkhtmltopdf.exe --enable-javascript --no-stop-slow-scripts --javascript-delay 2000 --debug-javascript
对此问题的解决方法的任何想法或建议
提前感谢您的帮助
【问题讨论】:
标签: javascript openlayers wkhtmltopdf html-to-pdf wkhtmltopdf-binary