使用Wicked_PDF渲染PDF,ChartKick图表为何不显示?
- 内容介绍
- 文章标签
- 相关推荐
本文共计340个文字,预计阅读时间需要2分钟。
我正在使用Rails 4,结合Wicked PDF和Chartkick Gem,来集成Google Charts。通过以下代码实现:rubyjavascript_include_tag //www.google.com/jsapi, chartkickChartkick视图提供了图表和所有预定义内容。当将PDF附加到URL时,`p`标签被使用。
我正在使用Rails 4,Wicked_PDF和Chartkick Gem对于Google Charts,我使用:
<%= javascript_include_tag
“//www.google.com/jsapi”, “chartkik” %>
html视图提供了图表和所有预期的内容.
当我将.pdf附加到网址时,pdf文档会在浏览器中显示,但ChartKick图表不会显示.
图表应出现以下错误:
Error Loading Chart: No adapter found
我在PDFKit文档中找到了以下内容.
Resources aren’t included in the PDF: Images, CSS, or JavaScript does
not seem to be downloading correctly in the PDF. This is due to the
fact that wkhtmltopdf does not know where to find those files. Make
sure you are using absolute paths (start with forward slash) to your
resources. If you are using PDFKit to generate PDFs from a raw HTML
source make sure you use complete paths (either file paths or urls
including the domain). In restrictive server environments the root_url
configuration may be what you are looking for change your asset host.
我假设wkhtmltopdf没有找到图表的链接,但我不知道如何解决这个问题.
有没有人有建议?
我找到了这个链接:
Render jQuery in wicked_pdf
Unixmonkey帮助FattRyan为Highcharts解决这个问题.
任何人都可以帮助如何设置此wicked_pdf_javascript_include_tag,以便Wicket_PDF可以使用Google图表接受Chartkick的图表吗?
在引用pdf布局中的CDN时,必须指定协议www.google.com/jsapi" %> <%= wicked_pdf_javascript_include_tag "chartkick" %>这就是我在我的一个项目中的表现.
干杯.
本文共计340个文字,预计阅读时间需要2分钟。
我正在使用Rails 4,结合Wicked PDF和Chartkick Gem,来集成Google Charts。通过以下代码实现:rubyjavascript_include_tag //www.google.com/jsapi, chartkickChartkick视图提供了图表和所有预定义内容。当将PDF附加到URL时,`p`标签被使用。
我正在使用Rails 4,Wicked_PDF和Chartkick Gem对于Google Charts,我使用:
<%= javascript_include_tag
“//www.google.com/jsapi”, “chartkik” %>
html视图提供了图表和所有预期的内容.
当我将.pdf附加到网址时,pdf文档会在浏览器中显示,但ChartKick图表不会显示.
图表应出现以下错误:
Error Loading Chart: No adapter found
我在PDFKit文档中找到了以下内容.
Resources aren’t included in the PDF: Images, CSS, or JavaScript does
not seem to be downloading correctly in the PDF. This is due to the
fact that wkhtmltopdf does not know where to find those files. Make
sure you are using absolute paths (start with forward slash) to your
resources. If you are using PDFKit to generate PDFs from a raw HTML
source make sure you use complete paths (either file paths or urls
including the domain). In restrictive server environments the root_url
configuration may be what you are looking for change your asset host.
我假设wkhtmltopdf没有找到图表的链接,但我不知道如何解决这个问题.
有没有人有建议?
我找到了这个链接:
Render jQuery in wicked_pdf
Unixmonkey帮助FattRyan为Highcharts解决这个问题.
任何人都可以帮助如何设置此wicked_pdf_javascript_include_tag,以便Wicket_PDF可以使用Google图表接受Chartkick的图表吗?
在引用pdf布局中的CDN时,必须指定协议www.google.com/jsapi" %> <%= wicked_pdf_javascript_include_tag "chartkick" %>这就是我在我的一个项目中的表现.
干杯.

