0
我想在我的PDF文檔中顯示世界區域明智地圖。我用一些jquery庫生成了map,但沒有打包出口到通過wicked_pdf生成的PDF文檔中的相同地圖。如何在PDF中使用wicked_pdf顯示動態地圖
我想在我的PDF文檔中顯示世界區域明智地圖。我用一些jquery庫生成了map,但沒有打包出口到通過wicked_pdf生成的PDF文檔中的相同地圖。如何在PDF中使用wicked_pdf顯示動態地圖
這裏是代碼爲我的作品(你可以將PDF的d = 1見HTML版本?):
def index
render :pdf => "pdf_with_map",
:disposition => "attachment",
:show_as_html => (params[:d] == "1"),
:layout => "pdf",
:orientation => 'Landscape'
end
這裏是PDF佈局:
!!!
%html
%head{:xmlns => 'http://www.w3.org/1999/xhtml', :lang => 'en', 'xml:lang' => 'en'}
%meta{:charset => "utf-8"}
%title PDF
= wicked_pdf_stylesheet_link_tag 'pdf'
= wicked_pdf_javascript_include_tag 'jquery', 'jquery-jvectormap', 'jquery-jvectormap-world-en', 'regionVectorMap'
= csrf_meta_tags
%body
#content
= yield
當您使用調試你會看到助手將JavasSript嵌入到HTML中。地圖沒有爲我工作,如果jquery是在寶石,我移動jquery到我的應用程序/資產,以便wicked_pdf_javascript_include_tag可以找到源;-)