Has anyone used wicked_pdf and wkhtmltopdf to generate pdf files from rails?
有没有人用过wicked_pdf和wkhtmltopdf从rails生成pdf文件?
wkhtmltopdf ( http://code.google.com/p/wkhtmltopdf/ ) is an c++ executable that the wicked_pdf gem ( https://github.com/mileszs/wicked_pdf ) essentially wraps. It works great for basic pdf generation of tables and reports.
wkhtmltopdf(http://code.google.com/p/wkhtmltopdf/)是一个c ++可执行文件,wicked_pdf gem(https://github.com/mileszs/wicked_pdf)基本上是包装的。它非常适用于表格和报告的基本pdf生成。
We're now looking to print some pages that have a lot of javascript content. Since the processing is all done server-side, there's obviously no browser to interpret the javascript.
我们现在打算打印一些包含大量javascript内容的页面。由于处理都是在服务器端完成的,因此显然没有浏览器可以解释javascript。
I've been looking around and can see that wkhtmltopdf supports some Javascript, but I'm also seeing that a lot of people are running into problems using it for complex javascript rendering.
我一直在环顾四周,可以看到wkhtmltopdf支持一些Javascript,但我也看到很多人在使用它进行复杂的javascript渲染时遇到了问题。
1 个解决方案
#1
3
Actually there is a browser engine in there. The WK in wkhtmltopdf stands for webkit which is the browser engine that is used to render HTML and javascript - Chrome uses that engine too.
实际上那里有一个浏览器引擎。 wkhtmltopdf中的WK代表webkit,它是用于呈现HTML和javascript的浏览器引擎 - Chrome也使用该引擎。
Do you have a specific thing that does not work? I use javascript and I have seen some quite complex javascript being used as well, for example generation of charts and they have seemed to work good enough. The headers and footers often used with wkhtmltopdf rely heavily on javascipt as well.
你有特定的东西不起作用吗?我使用javascript,我已经看到一些非常复杂的javascript被使用,例如生成图表,他们似乎工作得很好。经常与wkhtmltopdf一起使用的页眉和页脚也很大程度上依赖于javascipt。
I haven't used the ruby gem though.
我没有使用红宝石宝石。
#1
3
Actually there is a browser engine in there. The WK in wkhtmltopdf stands for webkit which is the browser engine that is used to render HTML and javascript - Chrome uses that engine too.
实际上那里有一个浏览器引擎。 wkhtmltopdf中的WK代表webkit,它是用于呈现HTML和javascript的浏览器引擎 - Chrome也使用该引擎。
Do you have a specific thing that does not work? I use javascript and I have seen some quite complex javascript being used as well, for example generation of charts and they have seemed to work good enough. The headers and footers often used with wkhtmltopdf rely heavily on javascipt as well.
你有特定的东西不起作用吗?我使用javascript,我已经看到一些非常复杂的javascript被使用,例如生成图表,他们似乎工作得很好。经常与wkhtmltopdf一起使用的页眉和页脚也很大程度上依赖于javascipt。
I haven't used the ruby gem though.
我没有使用红宝石宝石。