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
Getting Lazy with Vue and PDFs
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Ross Kaffenberger
January 16, 2019
Programming
2
1.5k
Getting Lazy with Vue and PDFs
I share the most important lessons learned while building a PDF Viewer in Vue.
Ross Kaffenberger
January 16, 2019
Tweet
Share
More Decks by Ross Kaffenberger
See All by Ross Kaffenberger
A Webpack Survival Guide for Rails Developers
rossta
1
2.7k
What I look for in a Junior Developer
rossta
2
1.1k
Progressive Web Apps on Rails
rossta
0
2.3k
Enumerable's Ugly Cousin - GORUCO Microtalk
rossta
0
430
Enumerator - Enumerable's Ugly Cousin
rossta
1
550
Recurring Events with Montrose
rossta
3
2.1k
Enumerable - How I Fell in Love with Ruby
rossta
20
4.8k
Create and Deploy an Ember App in 5 Minutes
rossta
7
3.7k
Other Decks in Programming
See All in Programming
どんと来い、データベース信頼性エンジニアリング / Introduction to DBRE
nnaka2992
1
280
new(1.26) ← これすき / kamakura.go #8
utgwkk
0
2.2k
ポーリング処理廃止によるイベント駆動アーキテクチャへの移行
seitarof
3
1k
Agentic AI: Evolution oder Revolution
mobilelarson
PRO
0
160
CSC307 Lecture 13
javiergs
PRO
0
320
コーディングルールの鮮度を保ちたい / keep-fresh-go-internal-conventions
handlename
0
190
ふつうの Rubyist、ちいさなデバイス、大きな一年
bash0c7
0
840
encoding/json/v2のUnmarshalはこう変わった:内部実装で見る設計改善
kurakura0916
0
400
nuget-server - あなたが必要だったNuGetサーバー
kekyo
PRO
0
230
AWS×クラウドネイティブソフトウェア設計 / AWS x Cloud-Native Software Design
nrslib
15
3k
Railsの気持ちを考えながらコントローラとビューを整頓する/tidying-rails-controllers-and-views-as-rails-think
moro
5
390
Goの型安全性で実現する複数プロダクトの権限管理
ishikawa_pro
1
250
Featured
See All Featured
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
470
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
360
30k
Test your architecture with Archunit
thirion
1
2.2k
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
210
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
Faster Mobile Websites
deanohume
310
31k
What’s in a name? Adding method to the madness
productmarketing
PRO
24
4k
Joys of Absence: A Defence of Solitary Play
codingconduct
1
300
New Earth Scene 8
popppiees
1
1.7k
Being A Developer After 40
akosma
91
590k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
2.4k
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
1
5.4k
Transcript
Ross Kaffenberger @rossta Getting Lazy with Vue and PDFs
Ross Kaffenberger @rossta Building a PDF Vue-er
#dadjokes
None
• ross kaffenberger @rossta
rossta.net/vue-pdfjs-demo
None
PDF.js fetching
None
PDF.js rendering
None
PDF.js in Vue
None
None
Problem: Large PDFs
•Lazy render: draw to canvas when visible •“Infinite” scroll: fetch
pages in batches
Iteration #1: Math!
None
None
None
None
None
None
None
None
Problem: Vue cannot watch $el properties
Manual work
None
None
None
None
Next iteration:
IntersectionObserver!
None
None
Advantages
•no $el property tracking •less code, fewer bugs •easier to
extend
Akryum/vue-observe-visibility
Lesson: Opt for Vue-friendliness
None
Lesson: Be curious and flexible
rossta/vue-pdfjs-demo
@rossta rossta.net/talks
[email protected]