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
9
votes
2 answers

PdfKit highlight annotation

I'm trying to add highlight annotations to documents using PDFKit on iOS. let highlight = PDFAnnotation(bounds: selection.bounds(for: page), forType: PDFAnnotationSubtype.highlight, …
guco
  • 91
  • 1
  • 4
9
votes
2 answers

pdfkit create pages using from_string

I am using pdfkit to generate pdf files from strings. ASK: Each string i pass to pdfkit i want it as a new page in the output pdf. i know this is possible using from_file like below. But, i do not want to write it to a file and use…
Headrun
  • 129
  • 1
  • 11
9
votes
2 answers

specify PDF page size using pdfkit in node js

I read in pdfkit manual that pdf page can be sized using size[width,height].But when i tried the following code its not working var PDFDocument = require('pdfkit'); var doc = new PDFDocument; doc.size=[50,50]; doc.end()
Hareesh Kumar K
  • 389
  • 1
  • 3
  • 8
9
votes
1 answer

JavaScript pdf generation library with Unicode support

I want to generate a pdf file using JavaScript at client side . Firstly I tried using jsPdf API . But it does not work with Unicode character like Chinese. Is there any option to enhance jspdf to support Unicode or any other library which supports…
Sumeet Kumar Yadav
  • 11,912
  • 6
  • 43
  • 80
9
votes
3 answers

wkhtmltopdf generates from PDF format on Ubuntu without X Server

Is it possible to set format of PDF to generate in wkhtmltopdf? From my PC wkhtmltopdf generates format "PDF-1.4" But remote Ubuntu 14.04 server that is generating pdf with a 'virtual' X server using xvfb giving format PDF-0: The only problem…
DAKZH
  • 243
  • 2
  • 12
9
votes
5 answers

pdfkit command failed: "/usr/bin/wkhtmltopdf" "--page-size" "Letter" ".... "--quiet" "-" "-"

i'm using pdfkit for generating pdf when i generate pdf it gives me following error. command failed: "/usr/bin/wkhtmltopdf" "--page-size" "Letter" "--margin-top" "0.75in" "--margin-right" "0.75in" "--margin-bottom" "0.75in" "--margin-left"…
Muhammad Ateq Ejaz
  • 1,845
  • 20
  • 22
8
votes
3 answers

Rails 3 and PDFKit, how can I convert an HTML file into a landscape orientation PDF?

I can convert HTML pages into PDF documents well. The problem is, I don't know how to convert the HTML file into a landscape orientation PDF. Is there a way to set that in the controller? From the controller... def pdf_customer_shipments @customer…
leonel
  • 10,106
  • 21
  • 85
  • 129
8
votes
7 answers

Rails 3.1 asset pipeline with PDFKit

I am using PDFkit with rails 3.1. In the past I was able to use the render_to_string function and create a pdf from that string. I then add the stylesheets as follows. My issue is that I have no idea how to access them from within the asset…
lundie
  • 337
  • 4
  • 24
8
votes
2 answers

How to use UTF-8 in PDFKit in Rails?

I'm using PDFKit in my Rails app to generate PDF's. Problem is some of my content in contains non-ascii characters. How do I force it to use UTF-8?
tybro0103
  • 48,327
  • 33
  • 144
  • 170
8
votes
1 answer

Save PDF file shown by PDFKit middleware

If somebody is interested in saving the PDF file in the filesystem which is shown by PDFKit middleware gem, then here it is... Override the call method of middleware.rb file. In overriding just replace this line: body =…
Ashish
  • 5,723
  • 2
  • 24
  • 25
8
votes
3 answers

pdfkit generates small scaled pdfs

I am using pdfkit in order to generate pdfs from html strings, rendered by my Django's views. For some reason, the output pdf is small. My pdfkit option dictionary is - options = { 'quiet': '', 'page-size': 'A4', …
Sahar
  • 436
  • 1
  • 4
  • 15
8
votes
6 answers

pdfkit not converting image to pdf

I am using PDFkit with python to convert an html page to pdf. In the html there is only one image tag in body with src pointing to a complete url like:
Manish Gupta
  • 4,438
  • 18
  • 57
  • 104
8
votes
0 answers

pdfkit (for python) - scale output to fit in single A4 pdf page

I'm using pdfkit Python libraries to convert an html page to pdf. All I'm doing is using the command: pdfkit.from_file('mypage.html', 'output.pdf') The problem is that I obtain a multiple-page pdf, whereas I'd like to have everything on one page.…
fatoddsun
  • 251
  • 1
  • 12
8
votes
3 answers

How to disable pdf view(PDFKIT) internal scrolling?

in my mac application pdfkit using for pdf reader.while scroll the mouse scroll the pages changing how can avoid that.pdfview's display mode is kPDFDisplaySinglePage.No need to work scroll Please help me
SHEBIN
  • 163
  • 1
  • 10
8
votes
1 answer

pdf file generated using python pdfkit has no clickable links?

The html file looks like
Phone: +00-0000000
E-mail: zsameem@gmail.com Github:
1 2
3
72 73