wicked-pdf

How to Install wkhtmltopdf?

戏子无情 提交于 2019-12-10 10:52:10
问题 Now i am working on rails 3.0.0.i am using Ubuntu 11.10 ,64 bit os.i want to install wkhtmltopdf.please tell me the static version of wkhtmltopdf. 回答1: Installing wkhtmltopdf on Ubuntu Linux machine First check os is 32 bit or 64 bit by using following command Try uname -m . It seems like the uname -m actually gives x86_64 when it is an kernel 64 bits Run following command sudo apt-get install openssl build-essential xorg libssl-dev libxrender-dev Then run following command sudo apt-get

Wicked pdf not rendering header/footer

元气小坏坏 提交于 2019-12-07 06:28:50
问题 I am using wicked_pdf for generating pdf from html on my rails project. It is rendering template but I could not manage to print header/footer sections. Below is my code that print only template section render pdf: "pdf_name", layout: 'application', template: 'reports/show', formats: [:html], margin: { top: 10, bottom: 10, left: 10, right: 10 }, disable_javascript: true, show_as_html: params[:debug], header: { html: { template: 'shared/header' }, spacing: 10 }, footer: { html: { template:

Rails 4 - how to make a link to a PDF file (name.PDF)?

此生再无相见时 提交于 2019-12-07 04:58:50
问题 I am generating PDF files and my link look like this: <%= link_to 'Invoice', display_invoice_path(invoice.id), :format => :pdf %> When I click on this, it takes me to /display_invoice/123456789 (it's an HTML version). In the controller action is following: def display_invoice if params[:invoice_number] @invoice = ... respond_to do |format| format.html format.pdf do #render pdf: '123', # file name render pdf: params[:invoice_number], layout: 'layouts/application.pdf.erb'#, # layout used #show

WickedPDF missing layout

怎甘沉沦 提交于 2019-12-07 04:10:02
问题 I have a controller like this: def show @professor = Professor.find(params[:id]) respond_to do |format| format.html format.pdf do render :pdf => "file_name" end end end And a simple view like this: <p>Professor: <%= @professor.first_name %></p> <p>Email: <%= @professor.email if @professor.email %></p> I also have a layout 'application.html.erb'; <!doctype html> <html> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <meta name="viewport" content=

wkhtmltopdf automatic page breaks

烈酒焚心 提交于 2019-12-07 01:03:19
问题 I'm using wkhtmltopdf v0.11.0 rc1 in a Rails application through wicked_pdf (I know wicked_pdf does not support the new command line parameter notation, I'm using my own fork of the gem). I thought that content not fitting within a page should automatically overflow to the next one, but this is not the case - I'm seeing text just being cut off, sometimes in the middle of a line. I know I can layout my pages using page-break-after:always , but this looks like dirty hard-coding, and besides the

wicked pdf side issue

南笙酒味 提交于 2019-12-06 14:58:24
问题 I'm exporting a table using wicked pdf here is the controller that use wicked def print_invoice respond_to do |format| format.pdf{ send_data render( ####### WICKED CODE ###### :pdf => "invoices", :margin => {:top=> 0,:bottom => 0,:left=> 0,:right => 0}, :orientation => "Landscape", :print_media_type => true,:disable_smart_shrinking => true) ) ####### END WICKED CODE ###### } end end Here is the print view <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <

How to Install wkhtmltopdf?

廉价感情. 提交于 2019-12-06 09:54:19
Now i am working on rails 3.0.0.i am using Ubuntu 11.10 ,64 bit os.i want to install wkhtmltopdf.please tell me the static version of wkhtmltopdf. Sunny Installing wkhtmltopdf on Ubuntu Linux machine First check os is 32 bit or 64 bit by using following command Try uname -m . It seems like the uname -m actually gives x86_64 when it is an kernel 64 bits Run following command sudo apt-get install openssl build-essential xorg libssl-dev libxrender-dev Then run following command sudo apt-get install wkhtmltopdf Based on OS download wkhtmltopdf package from following site http://code.google.com/p

Wicked_pdf stylesheet not working on Heroku

倾然丶 夕夏残阳落幕 提交于 2019-12-06 04:42:07
问题 I have a Rails app where I use wicked_pdf to generate PDF's. This is all fine and working locally, but when pushed to heroku the PDF does render, but without applying the stylesheet. Especially for PDF rendering I have a CSS file: app/assets/stylesheets/pdf.css.scss . And in form.pdf.haml I load the stylesheet like this: !!! %html{lang: "en", "xml:lang" => "en", xmlns: "http://www.w3.org/1999/xhtml"} %head %meta{content: "text/html; charset=UTF-8", "http-equiv" => "Content-Type"}/ = wicked

generate ZIP from generated PDFs with wicked_pdf

独自空忆成欢 提交于 2019-12-06 03:10:46
In my invoice system, I want a backup function to download all invoices at once in one zip file. This system is running on heroku - so it's only possible to save the pdfs temporary. I've the rubyzip and wicked_pdf gem installed. My current code in the controller: def zip_all_bills @bill = Bill.all if @bill.count > 0 t = Tempfile.new("bill_tmp_#{Time.now}") Zip::ZipOutputStream.open(t.path) do |z| @bill.each do |bill| @bills = bill @customer = @bills.customer @customer_name = @customer.name_company_id t = WickedPdf.new.pdf_from_string( render :template => '/bills/printing.html.erb',

wicked_pdf image rendering

两盒软妹~` 提交于 2019-12-05 16:27:36
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) SELECT `assets`.* FROM `assets` WHERE (`assets`.car_id = 29) Carmodel Load (0.2ms) SELECT `carmodels`.*