Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Speaker Deck
PRO
Sign in
Sign up for free
Wicked PDF - Essential Rails Gems
Jesse Wolgamott
April 10, 2013
Programming
4
370
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
48
What is an API
jwo
0
95
DIY Rails Authentication
jwo
0
160
ActionCable - For Not Another Chat App
jwo
3
890
SlackBot.rb - Create You a Slack Bot
jwo
1
810
react-rails: an isomorphic match made in heaven
jwo
0
810
Docker - next big thing
jwo
0
470
Ruby 2.1 Overview
jwo
0
500
Rails 4: Appetizers
jwo
1
520
Other Decks in Programming
See All in Programming
Haskellでオブジェクト指向プログラミング
koheisakata
0
120
Let's keep Commodore 64 alive for the next 40 years
mehowte
1
110
Power Automateドリブンのチームマネジメント
hanaseleb
0
190
「混ぜるな危険」を推進する設計
minodriven
7
2k
JetPackComposeは宣言型プログラミングパラダイムって実はよくわかってないんですが、別に使ってもいいんですよね、
conigashima
0
190
BASE BANKチームの技術選定と歴史 / how to decide technology selection for startup
budougumi0617
0
1.2k
Modern Android Developer ~ 안내서
pluu
1
650
1時間半で克服するJavaScriptの非同期処理/async_javascript_kokufuku
marchin1989
2
620
The strategies behind ddd – AdeoDevSummit 2022
lilobase
PRO
4
250
短納期でローンチした新サービスをJavaで開発した話/launched new service using Java
eichisanden
6
2k
Swift Regex
usamik26
0
190
UI Testing of Jetpack Compose Apps, AppDevCon
alexzhukovich
0
170
Featured
See All Featured
Designing for humans not robots
tammielis
241
23k
Learning to Love Humans: Emotional Interface Design
aarron
261
37k
Unsuck your backbone
ammeep
659
55k
A Modern Web Designer's Workflow
chriscoyier
689
180k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
15
950
jQuery: Nuts, Bolts and Bling
dougneiner
56
6.4k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
10
3.4k
Designing for Performance
lara
597
63k
Music & Morning Musume
bryan
35
4.2k
Making Projects Easy
brettharned
98
4.3k
How To Stay Up To Date on Web Technology
chriscoyier
780
250k
Fantastic passwords and where to find them - at NoRuKo
philnash
27
1.5k
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