Questions tagged [pdfkit]

PDFKit is a PDF document generation library built on top of wkhtmltopdf to convert HTML+CSS to pdf using Webkit.

Project homepage

PDFKit is for creating PDFs using plain old HTML+CSS. Uses wkhtmltopdf on the back-end which renders HTML using Webkit.

PDFKit comes with a middleware that allows users to get a PDF view of any page on your site by appending .pdf to the URL.

Uses wkhtmltopdf on the back-end which renders HTML using Webkit.

1084 questions
0
votes
0 answers

Using custom fonts in PDFKit with Javascript

I'm trying to use custom ttf fonts in PDFKit with Javascript. Fonts are stored locally. I'm getting a TypeError: fs.readFileSync is not a function on contents = fs.readFileSync(filename); of pdfkit.js (line 2429). I've tried many different custom…
Amirali
  • 116
  • 7
0
votes
0 answers

footer doesn't stay at bottom of page when converting to pdf with PDFKit

When I render the .html page, everything is OK, I have the footer in the right place, but when converting to PDF, the footer appears in top of the page. Do you have any idea how to correct that ? This is my CSS file (classical): footer { …
Ananas
  • 135
  • 1
  • 10
0
votes
2 answers

Rails4 + PDFKit + Fonts + Heroku not working

I'am trying to solve a font issue on heroku using PDFkit since few days and nothing seem to work for me.... I've already did few solutions such as : Convert LucidaHW from Squirrel and do as follow ... @font-face { font-family:…
C404
  • 243
  • 4
  • 14
0
votes
1 answer

How to get pdf data in pdfkit without saving it to file

I am using pdfkit in nodejs to create pdfs. Right now, to get the data from pdfDocument, I first write it to a file using 'fs' and then read back from it. I want to be able to use the data directly from pdfDocument object and send it as a response.…
Shamas S
  • 7,507
  • 10
  • 46
  • 58
0
votes
2 answers

how to use PDFKit to capture wanted html div in Rails

I would like to generate PDF on an area I specify (like in a div id tag) I'ved started to use rails gem PDFKit by following the tutorial from railcast and the docs. So a simple .pdf link did the trick. <%= link_to 'Open PDF', invoice_path(@invoice,…
Axil
  • 3,606
  • 10
  • 62
  • 136
0
votes
1 answer

Problems with pdfkit rails

I am trying to generate pdfs on my website. I was doing this for some time using 'wicked_pdf', but after a server update where I work it had some problems (The error message contained something along the lines of "Authentication error" and "try…
Meldanen
  • 61
  • 11
0
votes
1 answer

Ruby on Rails: PDFKit not display characters correctly in CentOS

I've been using PDFKit to create pdf in Rails 4 on Ubuntu 13.04. Locally, It works fine and show html page with utf-8 encoding, but when I want to get pdf created in server(CentOS) pdf will be created but the contents are weird charracters(some…
Kaveh
  • 423
  • 1
  • 4
  • 12
0
votes
1 answer

how to configure page_offset and end in pdfkit

I have pdfkit successfully installed in my app. The output pdf file for any given html that is passed has some extra pages that I don't need. Page 2 is the only relevant page that I will need from the html files in the current project. The following…
jcuwaz
  • 187
  • 3
  • 14
0
votes
1 answer

Not able to save PDF Kit generated file to a Paperclip attachment in Rails 3.2.15

I am trying to save a pdf file (generated using Rails PDFKit gem) to a paperclip attachment. The MySQL table entry shows following for the paperclip attachment after saving the generated PDF file: 1 | pdf | !ruby/object:File {} | NULL | NULL …
0
votes
0 answers

Error with Ruby and PDFKit on Appfog

I'm trying to use PDFkit with Ruby on Rails on Appfog. I am using the gem wkhtmltopdf-binary and have also tried changing the PDFKit config.wkhtmltopdf path, as this answer on a related question suggests. I always get this…
António
  • 103
  • 1
  • 7
0
votes
1 answer

Rails wkhtmltopdf on Mac getting command failed

I'm using the gem 'pdfkit' in a Rails app. It is working fine on Heroku, but gets an error on my iMac. Error: command failed: "/users/myname/sites/ndeavor2/bin/wkhtmltopdf-amd64" The application wkhtmltopdf-amd64 is in the folder indicated in the…
Reddirt
  • 5,913
  • 9
  • 48
  • 126
0
votes
1 answer

Rails PDFKit Appearance Bug with Bootstrap

I grab my DOM with jQuery and send an AJAX request to create the PDF: // store html in variable var html = '' + $('html').html() + ''; // create pdf $.ajax({ url: '/quotes/generate_pdf', data: { html : html,…
martincarlin87
  • 10,848
  • 24
  • 98
  • 145
0
votes
1 answer

Cocoa PDFKit Unlocking Encrypted Files

I have a PDF document that has an owner password set but no user password. Therefore it is encrypted. I know the owner password and want to use PDFKit to confirm when the document has been decrypted. I have used the PDFDocument unlockWithPassword…
Craig Wanstall
  • 295
  • 3
  • 8
0
votes
1 answer

PDFkit ignore footer?

I have installed the PDFKit gem within my app and if i call .pdf on any of my urls it generates a pdf version of the page. config.middleware.use PDFKit::Middleware, :page_size => 'A4', :margin_top => '0.39in', :margin_right =>…
legendary_rob
  • 12,792
  • 11
  • 56
  • 102
0
votes
1 answer

I need an accurate PDF or image of an app's page

PDFkit doesn't get
elements at all, IMGkit renders blank images (the below method): def png file = Tempfile.new(Digest::MD5.hexdigest(rand(12).to_s), :encoding => 'ascii-8bit') file.write(IMGKit.new(request.referer).to_png) send_data…
t56k
  • 6,769
  • 9
  • 52
  • 115