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
99
votes
20 answers

How to avoid page break inside table row for wkhtmltopdf

I am generating pdf report from html page with one table. I am using wkhtmltopdf for the purpose. when pdf is generated it breaks anywhere in tr tag. I want to avoid it .
Mohammad Sadiq Shaikh
  • 3,160
  • 9
  • 35
  • 54
60
votes
14 answers

Can't create pdf using python PDFKIT Error : " No wkhtmltopdf executable found:"

I tried installing pdfkit Python API in my windows 8 machine. I'm getting issues related to path. Traceback (most recent call last): File "C:\Python27\pdfcre", line 13, in pdfkit.from_url('http://google.com', 'out.pdf') File…
Arun Prakash
  • 913
  • 2
  • 8
  • 11
47
votes
11 answers

Wkhtmltopdf Characters in single line partially cut between pages

I am working in a project using ruby on rails(3.1). My requirement is to produce pdf from the html content. So I use pdfkit gem. In some pages, characters in single line partially cut between pages. When I convert html convert to pdf using pdfkit…
amexn
  • 2,158
  • 6
  • 33
  • 56
39
votes
8 answers

Saving PDF Files with Swift in iOS and display them

I want to build an app which also includes the possibility to show and save PDFs inside the app and display them (as a FileSystem) within a tableview and open them when I tap on one PDF. Here are my important questions for that: 1. How do I save a…
MkaysWork
  • 625
  • 1
  • 7
  • 11
37
votes
7 answers

Why does PDFKit/wkhtmltopdf hang but renders PDF as expected when Rails app is killed?

Background After reading around it seemed to me that Prawn is out and wkhtmltopdf is in. It also seems like the PDFKit and wicked_pdf gems for Rails are the new cool. So I found a screencast by Ryan on how to use PDFKit. I installed everything,…
robmclarty
  • 2,215
  • 2
  • 20
  • 21
26
votes
10 answers

Rails: Why "sudo" command is not recognized?

In my application directory (on Windows) I run: sudo pdfkit --install-wkhtmltopdf as explained here, but I got this error: 'sudo' is not recognized as an internal or external command, operable program or batch file. What could be the…
Misha Moroshko
  • 166,356
  • 226
  • 505
  • 746
19
votes
6 answers

pdfkit does not style pdfs

I have a rails 3.1 app that creates pdf documents using pdfkit, and everything works as specified, except for the fact that the generated pdfs don't have any styling. I am assuming that wkhtmltopdf doesn't have access to my stylesheets and that it…
tomciopp
  • 2,602
  • 2
  • 31
  • 60
17
votes
1 answer

how to convert pdfkit object into buffer using nodejs

I am generating pdf document using pdfkit(nodejs module).i need to convert the pdfkit object to buffer and send response as attachment file without save a file in server. i was using output function to achieve…
sridhar
  • 861
  • 3
  • 10
  • 14
16
votes
5 answers

How we can resolve "Solving environment: failed with initial frozen solve. Retrying with flexible solve." issue while installing the new conda package

I have tried to install new package in conda for windows using the following command: conda install -c conda-forge python-pdfkit but got the following error: Collecting package metadata (current_repodata.json): done Solving environment: failed with…
Rajesh Potnuru
  • 161
  • 1
  • 1
  • 5
16
votes
6 answers

Node js, piping pdfkit to a memory stream

I am using pdfkit on my node server, typically creating pdf files, and then uploading them to s3. The problem is that pdfkit examples pipe the pdf doc into a node write stream, which writes the file to the disk, I followed the example and worked…
Mahmoud Ezzat
  • 253
  • 1
  • 2
  • 9
15
votes
1 answer

How to solve "wkhtmltopdf reported an error: Exit with code 1 due to network error: ProtocolUnknownError" in python pdfkit

I'm using Django. This is code is in views.py. def download_as_pdf_view(request, doc_type, pk): import pdfkit file_name = 'invoice.pdf' pdf_path = os.path.join(settings.BASE_DIR, 'static', 'pdf', file_name) template =…
Nori
  • 2,340
  • 1
  • 18
  • 41
14
votes
3 answers

Create PDF with multiple pages

I need to implement a functionality of creating pdf with multiple pages of a text. class PDFCreator { func prepareData() -> Data { //1 let pdfMetaData = [ kCGPDFContextCreator: "PDF Creator", kCGPDFContextAuthor: "Pratik…
Pratik Sodha
  • 3,679
  • 2
  • 19
  • 38
14
votes
3 answers

wicked_pdf does not run on Ubuntu server : wkhtmltopdf: cannot connect to X server

I'm trying to use wicked_pdf on my prod server but it keeps failling : RuntimeError (Failed to execute: "/usr/bin/wkhtmltopdf" -q "file:////tmp/wicked_pdf20130709-23109-1adqx5g.html"…
Syl
  • 3,719
  • 6
  • 35
  • 59
13
votes
3 answers

Convert HTML to PDF or PNG without headeless browser instance in NodeJS

TL;DR: Any suggestions in NodeJS to convert an HTML to PDF or PNG without any headless browser instances. Also anyone uses puppeteer in any production environment. I would like to know how the resource utilisations and performance of running…
Anand Prem
  • 397
  • 5
  • 15
13
votes
3 answers

render_to_string does not find partials (PDFKit controller response)

Ruby 1.8.7, Rails 3.0.4, PDFKit 0.5.0 I'm trying to create a PDF with PDFKit without using the middleware so I can disable javascript (there's an accordion action in there that hides a lot of info that should be on the PDF). However, whenever I try,…
Chicagogrrl
  • 479
  • 3
  • 10
1
2 3
72 73