Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Wicked PDF - Essential Rails Gems
Search
Jesse Wolgamott
April 10, 2013
Programming
4
410
Wicked PDF - Essential Rails Gems
PDF Creation that Doesn't Suck
Jesse Wolgamott
April 10, 2013
Tweet
Share
More Decks by Jesse Wolgamott
See All by Jesse Wolgamott
React vs React-Native
jwo
0
79
What is an API
jwo
0
140
DIY Rails Authentication
jwo
0
170
ActionCable - For Not Another Chat App
jwo
3
1.2k
SlackBot.rb - Create You a Slack Bot
jwo
1
1.1k
react-rails: an isomorphic match made in heaven
jwo
0
1.1k
Docker - next big thing
jwo
0
720
Ruby 2.1 Overview
jwo
0
730
Rails 4: Appetizers
jwo
1
750
Other Decks in Programming
See All in Programming
SpringBoot+MyBatisで例外が出たときどこを見るか
syukai
0
110
Ruby製社内ツールのGo移行
bgpat
2
330
今の SmartHR にエンジニアで入社するとどうなるの?
daisukeshinoku
5
4.6k
Tailwind CSSを本気でカスタマイズする方法
fsubal
2
260
入門 AWS Amplify Gen2 / Introduction to AWS Amplify Gen2
genkiogasawara
1
310
ゆるい個人開発のススメ
kuroppe1819
10
940
0→1と1→10の狭間で Javaという技術選定を振り返る/Reflecting on the Decision to Choose Java Between Scaling from 0 to 1 and 1 to 10
jaguar_imo
2
370
チーム力を高めるスクラム実践法:カンバン公開と課題攻略について - ニフティのスクラムトーク Vol. 2 - NIFTY Tech Talk #18
niftycorp
PRO
1
110
Site Reliability Engineering for GMO
pyama86
6
940
Rubyでたのしむクリエイティブコーディング/Enjoy Creative coding with Ruby
chobishiba
1
160
From Spring Boot 2 to Spring Boot 3 with Java 21 and Jakarta EE
ivargrimstad
0
1.1k
Java 22 Overview
kishida
1
170
Featured
See All Featured
Testing 201, or: Great Expectations
jmmastey
27
6.3k
How GitHub Uses GitHub to Build GitHub
holman
468
290k
5 minutes of I Can Smell Your CMS
philhawksworth
199
19k
Side Projects
sachag
451
41k
Designing on Purpose - Digital PM Summit 2013
jponch
110
6.4k
Design by the Numbers
sachag
274
18k
The Language of Interfaces
destraynor
151
23k
How STYLIGHT went responsive
nonsquared
92
4.8k
Imperfection Machines: The Place of Print at Facebook
scottboms
258
12k
Clear Off the Table
cherdarchuk
83
310k
Happy Clients
brianwarren
91
6.4k
Building Applications with DynamoDB
mza
88
5.6k
Transcript
WICKED PDF Essential Rails Gems by @jwo for @houstonrb Tuesday,
April 9, 13
PDF Creation that doesn’t suck Prawn Prince PDF Pdfkit Rtek
(latex) DocRaptor acts_as_flying_saucer Tuesday, April 9, 13
Why Wicked PDF Great API Uses HTML/CSS you’re used to
Can use javascript in your PDFs Tuesday, April 9, 13
Bad Parts Difficult to render outside of Rails Request (Though
not impossible, see codebase at end) The Binary is hard to get configured to be found Tuesday, April 9, 13
Rails 4? Does not work for CSS/JS at time of
creation :( Tuesday, April 9, 13
Install gem install wicked_pdf Tuesday, April 9, 13
Development group :development do gem "wkhtmltopdf-binary" end Tuesday, April 9,
13
Production group :production do gem 'wkhtmltopdf-heroku' end Tuesday, April 9,
13
Recommended Workflow Create the PDF monthly Save PDF to S3
in CarrierWave Send link to download file Tuesday, April 9, 13
Hints Have a report.scss that includes parts you need to
include Have a report.js that includes parts asset_sync is your friend Easiest to render partials Tuesday, April 9, 13
Saving PDFs (CarrierWave) pdf = RendersPdf .new("statement/_show", {as_of_date: Date.today} )
.render account.account_statement.store!(pdf) Tuesday, April 9, 13
Must Do’s Add “application/pdf”, :pdf to MimeTypes respond_to do |format|
format.html format.pdf do render :pdf => "file_name", layout: 'report.html', "javascript-delay" => 5000 end end Tuesday, April 9, 13
Example Tuesday, April 9, 13
What did we just see? Using Bootstrap in your PDFs
Using Morris.js to graph in your PDFs Tuesday, April 9, 13
Codebase https://github.com/jwo/railsdotpdf http://railsdotpdf.herokuapp.com/ Tuesday, April 9, 13