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
13
votes
1 answer

PDFKit Node.js measurement unit

What is the measurement unit used in PDFKit (Node.js)? For example we use: doc.text(20, 20, 'Message') What does 20(x) and 20(x) stand for? Is it centimeter, millimeter, inch? Can I change it to any familiar format like cm, mm, or inch? Any ideas?
Hello World
  • 2,673
  • 7
  • 28
  • 60
13
votes
5 answers

pdfView pinch zooming out

I am trying to move my project that was using a webview to display some pdf to a pdfView to take advantage of the latest PDFKit features. in the webview when pinching to zoom out the document was always scaling to fill the screen. basically you…
Julien7377
  • 475
  • 4
  • 15
13
votes
3 answers

Rendered PDF looks different in production - Rails, PDFKit, wkhtmltopdf

I am using Rails pdfkit gem to render multi-page pdf files. The rendered pdf file picks up the CSS(SCSS) styling and page breaks as expected. However, when I try to render the same pdf document in production, it seems like the styling only loads…
dimitry_n
  • 2,939
  • 1
  • 30
  • 53
12
votes
3 answers

PDFKit - PDFView using pageViewController - page rendering slow when swiping to next page

I have a PDFView that's set to use a pageViewController: let pdfView = PDFView() let pdfDoc = PDFDocument(url: Bundle.main.url(forResource: "test", withExtension: "pdf")!) pdfView.document = pdfDoc pdfView.autoScales = true …
SwiftedMind
  • 3,701
  • 3
  • 29
  • 63
11
votes
2 answers

pdfkit- Warning: Blocked access to file

I am getting an error(Blocked access to the file) in HTML to pdf conversion using pdfkit library while using a local image in my HTML file. How can I use local images in my HTML file?
sanjay
  • 514
  • 2
  • 5
  • 14
11
votes
2 answers

html-pdf converters that are compatible with css flex-box

I am trying to put together a pdf from html template code. The problem I am running into is that the html-pdf converters I have tried don't format the css properly, I guess they are not yet compatible with css flex-box. I have looked at two…
11
votes
1 answer

PDFAnnotation with PDFAnnotationSubtype equal to .widget is not refreshing its appearance after adding it to PDFPage

After adding annotation to PDFPage (and rendering it on a screen), there is no way to update its appearance on PDFPage/PDFView. To reproduce the problem: Create PDFAnnotation and add it to the PDFPage: let bounds = CGRect(x: 20.0, y: 20.0, width:…
Rafał Rębacz
  • 486
  • 2
  • 11
11
votes
2 answers

PDFKit doesn't display custom font

I am trying to use a custom font in a pdf I generate from html with PDFKit in my Rails app. I added the font in ...app/assets/fonts/ and included it in my html template: css: @font-face { font-family: 'journal'; src:…
uralika
  • 193
  • 2
  • 8
11
votes
2 answers

Importing full SVG with PDFKit

Does anyone know if it's possible to import a full SVG into a PDFKit document? I can see from the docs that it has full SVG support, and there are methods for drawing paths etc, but I cannot see a method for importing a full SVG document.
jcvandan
  • 14,124
  • 18
  • 66
  • 103
11
votes
2 answers

Test download of pdf with rspec and pdfkit

I am developing a rails 3.2 application with which users can download pdfs. I enjoy test driven development a lot using rspec and shoulda matchers, but I'm at a loss with this one. I have the following code inside my controller: def show_as_pdf …
Dennis Hackethal
  • 13,662
  • 12
  • 66
  • 115
10
votes
0 answers

Swift PDFView issue: .notdef: no mapping

I get odd error messages with PDFView from PDFKit. In some instance I get non-isolated groups aren't supported. Mutating glyph 1 (code 32) in ULBEWJ+MinionPro-Regular. In another instance I get the message: .notdef: no mapping. In most PDF's I…
TinaDitte
  • 136
  • 6
10
votes
4 answers

How can I add page numbers to PDFKit generated PDFs?

I have multiple pages generated using PDFKit. How can I add page numbers to the bottom?
Satchel
  • 16,414
  • 23
  • 106
  • 192
10
votes
4 answers

Rails PDFKit command failed

I'm trying to use PDFKit as middleware in a rails 3 app. I can use wkhtmltopdf from the command line just fine, but my app keeps throwing me this error command failed: "/Users/bobby/.rvm/gems/ruby-1.9.2-p0/bin/wkhtmltopdf" "--page-size" "Letter"…
Pierre
  • 8,368
  • 4
  • 34
  • 50
9
votes
5 answers

iOS PDFKit not filling UIView

I'm using PDFKit to display simple PDF's. When I display them on the screen inside a UIView, I've used the code below. Aims: - Start off with the content to fill the view - want to fill whole screen width wise override func viewDidLoad() { …
Nicholas Farmer
  • 773
  • 7
  • 32
9
votes
6 answers

How can selection be disabled in PDFView?

Displaying a PDFDocument in a PDFView allows the user to select parts of the document and perform actions e.g. "copy" with the selection. How can selection be disabled in a PDFView while preserving the possibility for the user to zoom in and out and…
christopher.online
  • 2,614
  • 3
  • 28
  • 52
1
2
3
72 73