Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Criação de PDFs com Ruby
Search
Tomas Coelho
July 22, 2023
Technology
400
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Criação de PDFs com Ruby
Tomas Coelho
July 22, 2023
Other Decks in Technology
See All in Technology
[JAWS-UG彩の国埼玉#12]そろそろ準備する?re:Invent2026をやさしく解説 / reinvent2026-sainokuni
sh_fk2
1
340
JAWS-UGグッズ職人仕事の流儀
kentapapa
0
110
AIがコードを書く時代に、エンジニアは何で自分の価値を証明するのか / In an era where AI writes code how do engineers prove their value
carta_engineering
3
1.1k
その Valkey 使いこなしていますか?
onk
PRO
5
1.5k
パスキーの自動テストはどこまでいけるのか
teamlab
PRO
0
250
Railsで挑む大量データ永続化 〜600億件を永続化するための設計とボトルネックとの戦い〜
occhi
1
580
M5Stackで作る BLEマウス GPSログの世界
tomokusaba
0
430
「事実」を「計測」して、「解釈」する 〜AWS Lambdaのメモリ最適解の見つけ方〜
maimyyym
0
170
サブエージェントと Claude Mods で作る独自 Advisor ツールの話
kenichiodo
2
160
Temporal 最高!でも改めて「日付」について調べたら人類の負債すぎる件
riyaamemiya
0
150
Claude の新機能を、 出た日に触って社内に届けるまで
rfdnxbro
1
180
分析AIエージェントを育てる、動く環境を育てる
codatum
1
1.1k
Featured
See All Featured
Google's AI Overviews - The New Search
badams
0
1.6k
Exploring anti-patterns in Rails
aemeredith
4
540
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
1.1k
The #1 spot is gone: here's how to win anyway
tamaranovitovic
4
1.2k
Speed Design
sergeychernyshev
33
2.2k
A better future with KSS
kneath
240
18k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
56k
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
520
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.8k
Design in an AI World
tapps
1
350
We Have a Design System, Now What?
morganepeng
55
8.4k
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
2
480
Transcript
A anatomia de um documento digital 📄 Saiba como manipular
PDFs sem programação
Tomás Coêlho • Trabalho com Ruby desde 2019 • Atualmente
na DocSales • Quase terminando 😅 Engenharia de Computação na UFC • Telegram: @tomascco • Linkedin: in/tomascco • Twitter: @tomasccoelho
Qual a importância de tratar sobre documentos digitais? 💭
Portable Document Format: O padrão de várias indústrias Document management
— Portable document format — Part 1: PDF 1.7, 2008. Pág vii.
Portable Document Format: Objetivo: “Permitir a troca de documentos digitais
de maneira fácil e robusta, independente do ambiente em que esses documentos foram criados ou do ambiente em que serão exibidos ou impressos.” Document management — Portable document format — Part 1: PDF 1.7, 2008. Pág vii.
Portable Document Format: Formato Header Body Cross-reference Table Trailer Document
management — Portable document format — Part 1: PDF 1.7, 2008. Pág 39, seção 7.5.1
Portable Document Format: Tipos de objetos
Portable Document Format: Booleanos • true • false Document management
— Portable document format — Part 1: PDF 1.7, 2008. Seção 7.3.2
Portable Document Format: Numéricos • 123 • +17 • -18
• +12.5 • -20.4 • -.2 Document management — Portable document format — Part 1: PDF 1.7, 2008. Seção 7.3.3
Portable Document Format: Strings • (Hello World) • <48656C6C6F20776F726C64> Document
management — Portable document format — Part 1: PDF 1.7, 2008. Seção 7.3.4
Portable Document Format: Name (símbolos) • /Type • /Page •
/F13 Document management — Portable document format — Part 1: PDF 1.7, 2008. Seção 7.3.5
Portable Document Format: Array • [30 /Type (String) true] Document
management — Portable document format — Part 1: PDF 1.7, 2008. Pág 14, seção 7.3.6
Portable Document Format: Dictionary • << /Type /Page /Length 304
/ItemComTexto (texto aqui) /SubDicionario << /Item1 50.4 >> >> Document management — Portable document format — Part 1: PDF 1.7, 2008. Pág 14, seção 7.3.7
Portable Document Format: Stream • << /Length 56 >> stream
1.0 0.0 0.0 RG 0.5 0.75 1.0 rg 97.72 220.84 400 400 re B endstream Document management — Portable document format — Part 1: PDF 1.7, 2008. Pág 14, seção 7.3.8
Portable Document Format: Estrutura lógica Document management — Portable document
format — Part 1: PDF 1.7, 2008. Seção 7.7
Portable Document Format: Estrutura lógica Document management — Portable document
format — Part 1: PDF 1.7, 2008. Seção 7.7
“Talk is cheap, show me the PDFs”
Como gerar PDFs 📄 Usando Ruby
Mas qual é exatamente o problema? 😐
“Fazer um programa capaz de gerar um arquivo PDF. A
entrada desse programa deve ser alguma representação dos objetos PDF que o arquivo final deverá conter.”
Representação?
Temos uma escolha a fazer 💭
Resultado https://github.com/tomascco/digital_document
Exemplos Se transforma em
Exemplos Se transforma em
Resultado 🤯🤯🤯
E como converter essa representação para um arquivo PDF? 🤔
Bônus: e como modificar um PDF que já existe?
Representação Intermediária (Ruby) Arquivo PDF
Representação Intermediária (Ruby) Arquivo PDF Análise léxica e sintática
https://github.com/yob/pdf-reader