CARVIEW |
Select Language
HTTP/2 302
server: nginx
date: Mon, 01 Sep 2025 04:00:41 GMT
content-type: text/plain; charset=utf-8
content-length: 0
x-archive-redirect-reason: found capture at 20100622023621
location: https://web.archive.org/web/20100622023621/https://github.com/jdpace/PDFKit/tree/v0.2.3
server-timing: captures_list;dur=0.697857, exclusion.robots;dur=0.024145, exclusion.robots.policy;dur=0.010410, esindex;dur=0.011086, cdx.remote;dur=24.541540, LoadShardBlock;dur=179.920655, PetaboxLoader3.datanode;dur=66.741409, PetaboxLoader3.resolve;dur=45.167355
x-app-server: wwwb-app212
x-ts: 302
x-tr: 265
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=0
set-cookie: wb-p-SERVER=wwwb-app212; path=/
x-rl: 0
x-na: 0
x-page-cache: BYPASS
server-timing: BYPASS
x-nid: DigitalOcean
referrer-policy: no-referrer-when-downgrade
permissions-policy: interest-cohort=()
x-location: _pdf
HTTP/2 200
server: nginx
date: Mon, 01 Sep 2025 04:00:41 GMT
content-type: text/html; charset=utf-8
x-archive-orig-server: nginx/0.7.61
x-archive-orig-date: Tue, 22 Jun 2010 02:36:21 GMT
x-archive-orig-connection: close
x-archive-orig-status: 200 OK
x-archive-orig-etag: "07498bf5cd6266d8099092c58c6d5e05"
x-archive-orig-x-runtime: 65ms
x-archive-orig-content-length: 25589
x-archive-orig-cache-control: private, max-age=0, must-revalidate
x-archive-guessed-content-type: text/html
x-archive-guessed-charset: utf-8
memento-datetime: Tue, 22 Jun 2010 02:36:21 GMT
link: ; rel="original", ; rel="timemap"; type="application/link-format", ; rel="timegate", ; rel="first memento"; datetime="Tue, 22 Jun 2010 02:36:21 GMT", ; rel="memento"; datetime="Tue, 22 Jun 2010 02:36:21 GMT", ; rel="last memento"; datetime="Tue, 22 Jun 2010 02:36:21 GMT"
content-security-policy: default-src 'self' 'unsafe-eval' 'unsafe-inline' data: blob: archive.org web.archive.org web-static.archive.org wayback-api.archive.org athena.archive.org analytics.archive.org pragma.archivelab.org wwwb-events.archive.org
x-archive-src: 52_16_20100622003544_crawl101-c/52_16_20100622023515_crawl101.arc.gz
server-timing: captures_list;dur=0.519264, exclusion.robots;dur=0.019785, exclusion.robots.policy;dur=0.009567, esindex;dur=0.011833, cdx.remote;dur=7.033499, LoadShardBlock;dur=113.201460, PetaboxLoader3.datanode;dur=85.094713, PetaboxLoader3.resolve;dur=80.165667, load_resource;dur=98.636536
x-app-server: wwwb-app212
x-ts: 200
x-tr: 272
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=0
x-rl: 0
x-na: 0
x-page-cache: BYPASS
server-timing: BYPASS
x-nid: DigitalOcean
referrer-policy: no-referrer-when-downgrade
permissions-policy: interest-cohort=()
x-location: _pdf
content-encoding: gzip
jdpace's PDFKit at v0.2.3 - GitHub
jdpace / PDFKit
- Source
- Commits
- Network (9)
- Issues (4)
- Downloads (8)
- Wiki (1)
- Graphs
-
Tag:
v0.2.3
click here to add a description
click here to add a homepage
PDFKit /
name | age | message | |
---|---|---|---|
![]() |
.document | Fri May 21 06:21:27 -0700 2010 | Initial commit to PDFKit. [jdpace] |
![]() |
.gitignore | Fri May 21 06:21:27 -0700 2010 | Initial commit to PDFKit. [jdpace] |
![]() |
LICENSE | Fri May 21 06:21:27 -0700 2010 | Initial commit to PDFKit. [jdpace] |
![]() |
README.md | Loading commit data... ![]() |
|
![]() |
Rakefile | ||
![]() |
VERSION | ||
![]() |
bin/ | Mon May 31 13:29:09 -0700 2010 | Bundle wkhtmltopdf and use it if it's not alrea... [jdpace] |
![]() |
lib/ | ||
![]() |
pdfkit.gemspec | ||
![]() |
spec/ | Mon May 24 13:53:01 -0700 2010 | Remove references to files named PDFKit vs pdfkit [jdpace] |
README.md
PDFKit
Create PDFs using plain old HTML+CSS. Uses wkhtmltopdf on the backend which renders HTML using Webkit.
Installation
- Install wkhtmltopdf (optional) PDFKit comes bundled with wkhtmltopdf binaries for Linux i386 and OS X i386 PDFKit defaults to user installed versions of wkhtmltopdf if found Installing wkhtmltopdf binary Download the latest binary from https://code.google.com/p/wkhtmltopdf/downloads/list ** Place the binary somewhere on your path (e.g /usr/local/bin)
Install PDFKit
$ gem install pdfkit
Usage
# PDFKit.new takes the HTML and any options for wkhtmltopdf
# run `wkhtmltopdf --extended-help` for a full list of options
kit = PDFKit.new(html, :page_size => 'Letter')
kit.stylesheets << '/path/to/css/file'
# Git an inline PDF
pdf = kit.to_pdf
# Save the PDF to a file
File.open('/path/to/save/pdf','w') {|file| file << pdf}
Middleware
PDFKit comes with a middleware that allows users to visit any to get a PDF view of any page on your site by appending .pdf to the URL.
Middleware Setup
Non-Rails Rack apps
# in config.ru
require 'pdfkit'
use PDFKit::Middleware
Rails apps
# in application.rb(Rails3) or environment.rb(Rails2)
require 'pdfkit'
config.middleware.use PDFKit::Middleware
With PDFKit options
# options will be passed to PDFKit.new
config.middleware.use PDFKit::Middleware, :print_media_type => true
Note on Patches/Pull Requests
- Fork the project.
- Make your feature addition or bug fix.
- Add tests for it. This is important so I don't break it in a future version unintentionally.
- Commit, do not mess with rakefile, version, or history. (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
- Send me a pull request. Bonus points for topic branches.
Copyright
Copyright (c) 2010 Jared Pace. See LICENSE for details.