Menu
  • HOME
  • TAGS

Header HTML has 100% height with wkhtmltopdf 0.12

wkhtmltopdf,wicked-pdf,pdfkit

Solved this by adding <!DOCTYPE html> at the top of the header HTML file. Somewhat capricious, I know......

How do I pass multiple StringIO into python-pdfkit?

python,pdf-generation,pdfkit,stringio

It's not your fault. This happens because pdf kit assumes each element in the list as a file path instead of file descriptor. here is the relevant code. I had a similar situation of HTML spread across multiple templates. I put them all in one string and pass the StringIO...

PDFKit: Unknown image format error for PNG

javascript,pdf,pdf-generation,pdfkit,node-pdfkit

I found a solution as per this https://github.com/devongovett/pdfkit/blob/master/lib/image.coffee just make sure your name your png files with at capital ending .PNG, it worked for me.

getting wrong number argument error using Rails

ruby,ruby-on-rails-3.2,pdfkit

Assuming, you are trying to download the pdf file. see the code below: #users_controller.rb: class UsersController < ApplicationController def download_pdf pdf = render_to_string(pdf: "test.pdf", template: "users/test.html.erb", encoding: "UTF-8") send_data pdf end end # Gemfile source 'https://rubygems.org' gem 'rails', '3.2.19' gem 'sqlite3' group :assets do gem 'sass-rails', '~> 3.2.3' gem 'coffee-rails',...

convert embedded ruby file to PDF file instead of only HTML file using Rails 3

ruby,ruby-on-rails-3.2,pdfkit

You can include your stylesheets by following: def download_pdf kit = PDFKit.new(File.open(Rails.root.join('app', 'views', 'users', 'download.html.erb'))) kit.stylesheets << Rails.root.join("app","assets","application.css") send_data(kit.to_pdf, :filename => 'report.pdf', :type => 'application/pdf', :disposition => 'inline') end ...

using pdfkit in node.js to send an HTTP response

node.js,pdfkit

Looks like it will work fine if I use doc.pipe res instead of doc.pipe fs.createWriteStream(res)

Append pdf extension to link

ruby-on-rails,pdf,append,pdfkit

<tr> shortened for brevity's sake <td><%= link_to 'Show', certification %></td> <td><%= link_to 'Edit', edit_certification_path(certification) %></td> <td><%= link_to 'Destroy', certification, method: :delete, data: { confirm: 'Are you sure?' } %></td> <td><%= link_to "Download PDF", certification_path(@certification, :format => "pdf") %></td> </tr> Okay from your code it seems you have used certification and...