wicked-pdf

Wicked-PDF not showing images, 'wicked_pdf_image_tag' undefined

▼魔方 西西 提交于 2019-12-03 12:07:58
I want to generate a PDF with our department logo in it. When I try to use the WickedPdf class in my controller (using the method described at https://github.com/mileszs/wicked_pdf ): def some_action image_tag_string = image_tag('logo.jpg') pdf = WickedPdf.new.pdf_from_string(image_tag_string) save_path = Rails.root.join('testpdfs','logotest.pdf') File.open(save_path, 'wb') do |file| file << pdf end end ...the application saves the PDF to the target directory, but it has a blue-and-white '?' mark where the image should be. If I do this instead: image_tag_string = wicked_pdf_image_tag('logo.jpg

Getting PDF from WickedPDF for attachment via Carrierwave

ⅰ亾dé卋堺 提交于 2019-12-03 10:28:17
In Rails3, I am using the WickedPDF gem to render a PDF format of one of my models. This is working fine: /invoices/123 returns HTML, /invoices/123.pdf downloads a PDF. In my Invoice model, I am using the state_machine gem to keep track of Invoice status. When an invoice goes from "unbilled" to "billed" state, I would like to grab a copy of the invoice PDF and attach it to the invoice model using CarrierWave. I have the three parts working separately: the controller creates a PDF view, the model tracks state and triggers a callback when making the correct transition, and CarrierWave is set up

ChartKick charts do not show when rendering to PDF using Wicked_PDF

孤者浪人 提交于 2019-12-01 23:29:31
问题 I am using Rails 4, Wicked_PDF and Chartkick Gem's For Google Charts I use: <%= javascript_include_tag "//www.google.com/jsapi", "chartkik" %> The html view comes up with charts and everything as expected. When I append .pdf to the url the pdf document shows in the browser but the ChartKick charts do not show. The following error appears where the chart should be: Error Loading Chart: No adapter found I have found the following online in the PDFKit documentation. Resources aren't included in

ChartKick charts do not show when rendering to PDF using Wicked_PDF

天大地大妈咪最大 提交于 2019-12-01 20:55:25
I am using Rails 4, Wicked_PDF and Chartkick Gem's For Google Charts I use: <%= javascript_include_tag "//www.google.com/jsapi", "chartkik" %> The html view comes up with charts and everything as expected. When I append .pdf to the url the pdf document shows in the browser but the ChartKick charts do not show. The following error appears where the chart should be: Error Loading Chart: No adapter found I have found the following online in the PDFKit documentation. Resources aren't included in the PDF: Images, CSS, or JavaScript does not seem to be downloading correctly in the PDF. This is due

wicked_pdf is not rendering header

无人久伴 提交于 2019-12-01 16:40:34
render :pdf => "file_name", :layout => 'pdf.html.erb', :template => 'transactions/show.pdf.erb', :wkhtmltopdf => WICKED_PDF_BIN, :show_as_html => true, :layout => 'pdf.html.erb', :header => {:html => { :template => 'shared/header.pdf.erb'}} PDF is generated fine, unfortunately I do not see the header. I can stick the header in the main layout and it works fine too. It seems to me that the header line above is not being processed. The filename 'header.pdf.erb' does not seem to matter. I can point it to a file that does not exist and it throws no error. This is Mac OS, Rails 3.2.1, ruby 1.9

wicked_pdf is not rendering header

試著忘記壹切 提交于 2019-12-01 15:27:57
问题 render :pdf => "file_name", :layout => 'pdf.html.erb', :template => 'transactions/show.pdf.erb', :wkhtmltopdf => WICKED_PDF_BIN, :show_as_html => true, :layout => 'pdf.html.erb', :header => {:html => { :template => 'shared/header.pdf.erb'}} PDF is generated fine, unfortunately I do not see the header. I can stick the header in the main layout and it works fine too. It seems to me that the header line above is not being processed. The filename 'header.pdf.erb' does not seem to matter. I can

Wicked PDF +fonts+heroku+rails3.2

喜你入骨 提交于 2019-12-01 15:24:01
I'm using wicked_pdf with rails 3.2.11 and ruby 1.9.3 to generate a PDF from HTML and deploying to Heroku. My pdf.css.scss.erb: <% app_fullhost = Constants["app_fullhost"] %> @font-face { font-family:'DosisMedium'; font-style:normal; font-weight:500; src: url(<%=app_fullhost%>/app/font/dosis/Dosis-Medium.ttf) format('woff'); } *, body { font-family: "DosisLight", 'Times New Roman', 'Arial', sans-serif; } where app_fullhost is the exact host, in development or production. My pdf layout includes among other things : %html{:lang => I18n.locale} %head %meta{:charset => "utf-8"} %title= content_for

Wicked PDF +fonts+heroku+rails3.2

南笙酒味 提交于 2019-12-01 15:13:58
问题 I'm using wicked_pdf with rails 3.2.11 and ruby 1.9.3 to generate a PDF from HTML and deploying to Heroku. My pdf.css.scss.erb: <% app_fullhost = Constants["app_fullhost"] %> @font-face { font-family:'DosisMedium'; font-style:normal; font-weight:500; src: url(<%=app_fullhost%>/app/font/dosis/Dosis-Medium.ttf) format('woff'); } *, body { font-family: "DosisLight", 'Times New Roman', 'Arial', sans-serif; } where app_fullhost is the exact host, in development or production. My pdf layout

WicketPDF rendering table not aligned properly and footer place at last page

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-01 14:01:50
I am generating pdf report from html page, I created the layout with header and footer separately , I need header only for first page and footer at last page, I tried some scripts for that but it is not working, and how to avoid page break inside table row and I need border for each page without breaking table row is breaking like as shown in an image. respond_to do |format| format.html format.pdf { render :pdf => "Report", :template => 'layouts/pdf_layout.pdf.erb', :layout => 'pdf_layout.pdf.erb', :margin => {:bottom => 35}, :page_size => 'A4', :header => {:content => render_to_string({

WicketPDF rendering table not aligned properly and footer place at last page

徘徊边缘 提交于 2019-12-01 13:15:53
问题 I am generating pdf report from html page, I created the layout with header and footer separately , I need header only for first page and footer at last page, I tried some scripts for that but it is not working, and how to avoid page break inside table row and I need border for each page without breaking table row is breaking like as shown in an image. respond_to do |format| format.html format.pdf { render :pdf => "Report", :template => 'layouts/pdf_layout.pdf.erb', :layout => 'pdf_layout.pdf