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

Python Django PDFKIT - [Errno 9] Bad file descriptor

I use pdfkit and wkhtmltopdf to generate pdf documents. When i generate the first pdf all is well. When i quickly (within 5 seconds) generate an other i get the error [Errno 9] Bad file descriptor. If i close the error (step back in browser) and…
phicon
  • 3,549
  • 5
  • 32
  • 62
8
votes
6 answers

PDFKit - Custom Fonts - fs.readFileSync is not a function

I'm using PDFKit for an application. I'm just using it in the Browser in an HTML file, with Javascript (no Node.js). I downloaded PDFKit from GitHub: https://github.com/devongovett/pdfkit/releases as well as Blob Stream:…
djt
  • 7,297
  • 11
  • 55
  • 102
7
votes
1 answer

Bootstrap not rendering

The question is splitted in different section: Little preamble and sharing of the tries done Folder structure and code to reproduce the problem Showing and explaining the problem Questions Preamble I have created a simple Flask 1.1.1 application…
Carlo Zanocco
  • 1,967
  • 4
  • 18
  • 31
7
votes
2 answers

PDFkit doesn't display pictures in PDF

Rails 2, PDFkit 0.5.0 Im generating a PDF from a View in Rails 2 with PDFkit and everything works fine. The only thing which doesn't work is displaying pictures in the pdf. When I look at the View in the Browser, the picture is there but its missing…
MarkoHiel
  • 15,481
  • 2
  • 21
  • 29
7
votes
1 answer

Merging PDF Files in Cocoa

I would like to concatenate several PDF files to form one single PDF. Now I've come so far that I know, PDFKit is the proper way to go (I guess). But I am not sure, how to accomplish the merging. Should I have one PDFDocument and several PDFPage…
tzippy
  • 6,458
  • 30
  • 82
  • 151
7
votes
3 answers

ios PDFKit displaymode = singlepage only shows the first page of the pdf

I'm trying to display a pdf on ios via apples PDFKit library, and rather than use PDFDisplayMode.singlePageContinuous mode, I want to stop at page breaks so I'm trying to use PDFDisplayMode.singlePage.…
shochu_king
  • 136
  • 2
  • 10
7
votes
1 answer

Add a password protection to an existing pdf file using PDFKit iOS

I wanted to add a password protection to an existing pdf file in my application. Here's my code: if let path = Bundle.main.path(forResource: "pdf_file", ofType: "pdf") { let url = URL(fileURLWithPath: path) if let pdfDocument =…
black1011
  • 284
  • 3
  • 18
7
votes
2 answers

How to know when user swipes to next page in PDFView of PDFKit?

In my iOS-App I'm using a PDFView with pdfView.usePageViewController(true, withViewOptions: nil). I want to hide the PDFThumbnailView when the user swipes to another page. I already looked inside PDFViewDelegate but there's no suitable function to…
heyfrank
  • 5,291
  • 3
  • 32
  • 46
7
votes
1 answer

PDFKit memory issues ios12

Edited this question to use a simpler version of the code. The TestPDF is all text and about 300 pages. As the loop runs it crashes after consuming 2gb of memory. I don’t need the value in the print statement after it’s printed. However the code…
RyanTCB
  • 7,400
  • 5
  • 42
  • 62
7
votes
2 answers

Using promises with PDFMake on Firebase Cloud Functions

I am using PDFMake (a variant of PDFKit) to generate PDFs on Firebase Cloud Functions using a realtime database trigger. The function gets all relevant data from the database and then passes it to the function that is supposed to generate the…
Gaurav Wadhwani
  • 1,352
  • 2
  • 15
  • 32
7
votes
3 answers

How to write images from URL to PDFkit?

I am getting a JPEG from a URL using node.js requests. I then convert the image to a base64 buffer and write it to the pdf document: request({ url: url, encoding: null }, function (error, response, body) { if (!error &&…
NightOwl
  • 1,069
  • 3
  • 13
  • 23
7
votes
1 answer

Tables in pdfMake.js and page break, how to delete bottom empty row

Table with empty row on this example you see, when the table breaks it leaves one empty row, that the same, as the first row on the next page. Question, how can I delete this empty row, that it looks better. Thank for help
Woldemar960
  • 71
  • 1
  • 4
7
votes
5 answers

How to add Header and footer content to pdfkit for node.js

I would like to generate a pdf using node js (express). I need to add header and footer to every page with page numbers. Any help would be appreciated. Thanks.
Akhil Gopan
  • 121
  • 1
  • 1
  • 16
7
votes
1 answer

Pdfkit OSError: No wkhtmltopdf executable found

I'm trying to convert a webpage to PDF, using pdfkit but it shows following error Traceback (most recent call last): File "", line 1, in runfile('H:/Python/Practice/pdf_read_write.py',…
MD. Khairul Basar
  • 4,976
  • 14
  • 41
  • 59
7
votes
5 answers

pdfkit headers and footers

I've been searching the web for examples of people using the pdfkit (python wrapper) in implementing headers and footers and could not find any examples. Would anyone be able to show some examples of how to implement the options in wkhtmltopdf using…
user3368835
  • 357
  • 2
  • 7
  • 15