wicked-pdf

How to use flexboxgrid with wicked_pdf?

倾然丶 夕夏残阳落幕 提交于 2019-12-13 20:22:41
问题 I need to convert a .haml view to .pdf using wicked_pdf (or another), the problem is ... I use flexboxgrid (try BootstrapGrid before but it does not work), the columns (.col-xs- *) do not work as it. Should idea? 回答1: wicked_pdf uses wkhtmltopdf to do the rendering, which right now is approximate to a very old version of Chrome/Chromium (like v. 13 or so), which doesn't support Flexbox. You'll likely need to add and load a pdf-specific stylesheet to tweak the layout using non-flexbox CSS

how validation is done using wicked?

白昼怎懂夜的黑 提交于 2019-12-13 16:55:21
问题 I have a users_controller and a user_steps_controller which has three steps :business, :payment and :login In the user.rb model class User < ActiveRecord::Base validates_presence_of :fname, :lname, :email, :mob, :country, :state, :suburb, :postal ,:add end while checking validation if i put some random values then also it is giving errors Fname can't be blank Lname can't be blank Email can't be blank Mob can't be blank Country can't be blank State can't be blank Suburb can't be blank Postal

wicked_pdf image rendering

廉价感情. 提交于 2019-12-13 12:28:48
问题 how do I get images of a product to show in pdf? I have this code in view file <div id="img-slide"> <% for asset in @car.assets %> <%= image_tag(asset.asset.url(:medium)) %> <% end %> </div> and it shows all images for this car. but if I use the same code in show.pdf.erb then instead of images I got only question marks.. like the image missing thing. So, is there a way to get them on paper? Thanks. p.s. there is what console is showing ***************WICKED*************** Asset Load (0.2ms)

Rails3 - wicked_pdf gem, footer issue when calling from action mailer model

喜你入骨 提交于 2019-12-12 08:16:27
问题 I'm using wicked_pdf pdf_from_string inside an action mailer rails 3 model. The pdf render perfectly doing this: attachments["pdf.pdf"] = WickedPdf.new.pdf_from_string( render_to_string(:pdf => "pdf.pdf",:template => 'documents/show.pdf.erb') ) When I try to pass the option :footer, it does not work with these options: attachments["pdf.pdf"] = WickedPdf.new.pdf_from_string( render_to_string(:pdf => "pdf.pdf", :template => 'pdf/pdf.html.erb', :layout => 'pdfs/pdf', :footer => {:html => {

Wicked-PDF not showing images, 'wicked_pdf_image_tag' undefined

 ̄綄美尐妖づ 提交于 2019-12-12 07:47:20
问题 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 '?'

Image header on PDF using wicked_pdf gem and wkhtmltopdf

霸气de小男生 提交于 2019-12-11 07:08:03
问题 My controller: def show respond_to do |format| format.pdf do #render :pdf => "show",:template => "welcome/show",:footer => { :right => 'Page [page] of [topage]' }) #render :pdf => "show",:template => "welcome/show", :header => {:content => render_to_string({:template => 'welcome/pdf_header.html.erb'})}, :footer=> { :right => 'Page [page] of [topage]' },:margin => { :top => 38, :bottom => 35} #render :pdf => "show",:handlers => [:html],:template => "welcome/show.pdf.erb", :header => {:content

WickedPDF different margin settings for first page?

自作多情 提交于 2019-12-11 02:57:43
问题 Using: wkhtmltopdf-binary 0.9.9.1 wicked_pdf 0.10.2 rails 4.1.7 ruby 2.1.3 OS X 10.10.1 (64-bit) I have a header that takes a bit of space, so I had to use :margin => { :top => 40 } (along with header spacing) in my WickedPDF options. However, I don't want this for my first page , because the header is only used on page 2 and above. How do I achieve this? Attempts For contents in the first page, via CSS I tried: position: absolute; top: -20; Which results in the content being "clipped" by the

Render jQuery in wicked_pdf

孤人 提交于 2019-12-11 00:08:55
问题 I'm using Highcharts in my application to render charts. Everything works fine, except when I want to convert a page that has charts to PDF. I'm using wicked_pdf. Here is the show method my controller: format.pdf do render :pdf => "report", :template => "/quarters/report.pdf.erb", end My /quarters/report.pdf.erb file looks like it does in my show.html.erb for highcharts: <div id="testcollections" style="width: 600px;"></div> <!-- jQuery for testing collections charts --> <script type="text

What is the correct way to render_to_string in wicked pdf?

好久不见. 提交于 2019-12-10 20:12:38
问题 This is what the documentation of wicked pdf specifies: WickedPdf.new.pdf_from_string( render_to_string(:pdf => "pdf_file.pdf", :template => 'templates/pdf.html.erb', :layout => 'pdfs/layout_pdf'), :footer => {:content => render_to_string({:template => 'templates/pdf_footer.html.erb', :layout => 'pdfs/layout_pdf'})} ) What i get is ActionView::MissingTemplate Even though i have pdf.html.erb in directory. I use a gen_pdf method in the application controller and an equivalent pdf.html.erb in

Embedding SVG in PDF using Wicked_PDF (wkhtmltopdf)

余生颓废 提交于 2019-12-10 17:25:59
问题 When I try to include an SVG in a PDF generated by wicked_pdf (wkhtmltopdf), it comes out blank. Any idea how to get the svg to display in the pdf? app/views/barcodes/to_pdf.html.haml <descriptive text here> %object#code_image{:data=>"/barcodes/generate_svg?code=4567898", :type=>"image/svg+xml", :height=>70} barcodes controller def generate_svg require 'barby' require 'barby/barcode/code_128' require 'barby/outputter/svg_outputter' barcode = Barby::Code128B.new(params[:code]) render :text =>