SlideShare a Scribd company logo
1 of 51
Rails PDF Generation John McCaffrey
What we’re going to cover ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Intro: after_me
[object Object],[object Object],[object Object]
[object Object],  Col 1   Col 2   Col 3   Col 4
Why users Love PDFs ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
PDF types and libraries
[object Object],[object Object],[object Object],[object Object]
What type should I use? ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Use HTML to PDF if.. ,[object Object],[object Object],[object Object],[object Object],[object Object]
HTML to PDF Libraries ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Use PDF Templates if.. ,[object Object],[object Object],[object Object],[object Object],[object Object]
PDF Template binding ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Use PDF Generation if.. ,[object Object],[object Object],[object Object],[object Object],[object Object]
PDF Generation Libraries ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
I chose Prawn ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Prawn history ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Prawn 101 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Prawn examples
Examples ,[object Object],[object Object],[object Object],[object Object],[object Object]
Examples ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Examples ,[object Object],[object Object],[object Object],[object Object],[object Object]
Text & Image Text_image_sample
Text overflow Text_overflow_sample
Page Orientation orientation sample
Examples ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Tables table sample
Utf-8 UTF-8 sample
Drawing & bounding_box bounding
Prawn Performance ,[object Object],[object Object],[object Object],[object Object],[object Object]
PDF TESTING
How do I test a PDF? ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
How do I test a PDF? ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Testing PDF structure
Testing PDF contents
Prawn-to
Prawn in your view ,[object Object],[object Object],[object Object],[object Object],[object Object]
Prawn-to: controller
Prawn-to: view Prawn-to sample
Advanced Prawn with_reckless_abandon
Advanced examples ,[object Object],[object Object],[object Object],[object Object],[object Object]
Grid Layout Grid sample
Grids & Labels Labels sample
Google Charts api Charts sample
Prawn-Format Nice and easy, just got nicer, and easier
Prawn-format ,[object Object],[object Object],[object Object],[object Object],[object Object]
Prawn-format: html and style Format
Putting it all together ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Twitter_Timelines
More to come ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Questions? speakerrate.com /jmccaffrey
Links ,[object Object],[object Object],[object Object],[object Object],[object Object],PDF Generation in Rails John McCaffrey

More Related Content

What's hot

Apidays Paris 2023 - Securing Microservice-based APIs, Michal Trojanowski, Cu...
Apidays Paris 2023 - Securing Microservice-based APIs, Michal Trojanowski, Cu...Apidays Paris 2023 - Securing Microservice-based APIs, Michal Trojanowski, Cu...
Apidays Paris 2023 - Securing Microservice-based APIs, Michal Trojanowski, Cu...apidays
 
Introduction to Foreman Maintain
Introduction to Foreman MaintainIntroduction to Foreman Maintain
Introduction to Foreman MaintainKavita Gaikwad
 
The world of Containers with Podman, Buildah, Skopeo by Seema - CCDays
The world of Containers with Podman, Buildah, Skopeo by Seema - CCDaysThe world of Containers with Podman, Buildah, Skopeo by Seema - CCDays
The world of Containers with Podman, Buildah, Skopeo by Seema - CCDaysCodeOps Technologies LLP
 
Agile Network India | What does it take to Transform into Product Centric IT ...
Agile Network India | What does it take to Transform into Product Centric IT ...Agile Network India | What does it take to Transform into Product Centric IT ...
Agile Network India | What does it take to Transform into Product Centric IT ...AgileNetwork
 
Microservice Architecture Patterns, by Richard Langlois P. Eng.
Microservice Architecture Patterns, by Richard Langlois P. Eng.Microservice Architecture Patterns, by Richard Langlois P. Eng.
Microservice Architecture Patterns, by Richard Langlois P. Eng.Richard Langlois P. Eng.
 
DevSecOps at Agile 2019
DevSecOps at   Agile 2019 DevSecOps at   Agile 2019
DevSecOps at Agile 2019 Elizabeth Ayer
 
TP Git avancé DevoxxFR 2018 (exercices)
TP Git avancé DevoxxFR 2018 (exercices)TP Git avancé DevoxxFR 2018 (exercices)
TP Git avancé DevoxxFR 2018 (exercices)Jérôme Tamborini
 
Progressive exposure using deployment rings and feature flags
Progressive exposure using deployment rings and feature flagsProgressive exposure using deployment rings and feature flags
Progressive exposure using deployment rings and feature flagsWilly-Peter Schaub
 
Openshift cheat rhce_r3v1 rhce
Openshift cheat rhce_r3v1 rhceOpenshift cheat rhce_r3v1 rhce
Openshift cheat rhce_r3v1 rhceDarnette A
 
Understanding MicroSERVICE Architecture with Java & Spring Boot
Understanding MicroSERVICE Architecture with Java & Spring BootUnderstanding MicroSERVICE Architecture with Java & Spring Boot
Understanding MicroSERVICE Architecture with Java & Spring BootKashif Ali Siddiqui
 

What's hot (11)

Apidays Paris 2023 - Securing Microservice-based APIs, Michal Trojanowski, Cu...
Apidays Paris 2023 - Securing Microservice-based APIs, Michal Trojanowski, Cu...Apidays Paris 2023 - Securing Microservice-based APIs, Michal Trojanowski, Cu...
Apidays Paris 2023 - Securing Microservice-based APIs, Michal Trojanowski, Cu...
 
Introduction to Foreman Maintain
Introduction to Foreman MaintainIntroduction to Foreman Maintain
Introduction to Foreman Maintain
 
The world of Containers with Podman, Buildah, Skopeo by Seema - CCDays
The world of Containers with Podman, Buildah, Skopeo by Seema - CCDaysThe world of Containers with Podman, Buildah, Skopeo by Seema - CCDays
The world of Containers with Podman, Buildah, Skopeo by Seema - CCDays
 
Agile Network India | What does it take to Transform into Product Centric IT ...
Agile Network India | What does it take to Transform into Product Centric IT ...Agile Network India | What does it take to Transform into Product Centric IT ...
Agile Network India | What does it take to Transform into Product Centric IT ...
 
Microservice Architecture Patterns, by Richard Langlois P. Eng.
Microservice Architecture Patterns, by Richard Langlois P. Eng.Microservice Architecture Patterns, by Richard Langlois P. Eng.
Microservice Architecture Patterns, by Richard Langlois P. Eng.
 
DevSecOps at Agile 2019
DevSecOps at   Agile 2019 DevSecOps at   Agile 2019
DevSecOps at Agile 2019
 
TP Git avancé DevoxxFR 2018 (exercices)
TP Git avancé DevoxxFR 2018 (exercices)TP Git avancé DevoxxFR 2018 (exercices)
TP Git avancé DevoxxFR 2018 (exercices)
 
Comenzando con Arquitecturas sin servidores
Comenzando con Arquitecturas sin servidoresComenzando con Arquitecturas sin servidores
Comenzando con Arquitecturas sin servidores
 
Progressive exposure using deployment rings and feature flags
Progressive exposure using deployment rings and feature flagsProgressive exposure using deployment rings and feature flags
Progressive exposure using deployment rings and feature flags
 
Openshift cheat rhce_r3v1 rhce
Openshift cheat rhce_r3v1 rhceOpenshift cheat rhce_r3v1 rhce
Openshift cheat rhce_r3v1 rhce
 
Understanding MicroSERVICE Architecture with Java & Spring Boot
Understanding MicroSERVICE Architecture with Java & Spring BootUnderstanding MicroSERVICE Architecture with Java & Spring Boot
Understanding MicroSERVICE Architecture with Java & Spring Boot
 

Similar to PDF Generation in Rails with Prawn and Prawn-to: John McCaffrey

Implementing Structured FrameMaker
Implementing Structured FrameMakerImplementing Structured FrameMaker
Implementing Structured FrameMakerDkadilak62263
 
Markdown - friend or foe?
Markdown - friend or foe?Markdown - friend or foe?
Markdown - friend or foe?Ellis Pratt
 
Tcs3 stc creating e pub and apps with tcs3
Tcs3 stc creating e pub and apps with tcs3Tcs3 stc creating e pub and apps with tcs3
Tcs3 stc creating e pub and apps with tcs3Matt Sullivan
 
1 Introduction to Drupal Web Development
1 Introduction to Drupal Web Development1 Introduction to Drupal Web Development
1 Introduction to Drupal Web DevelopmentWingston
 
Websites Unlimited - Pay Monthly Websites
Websites Unlimited - Pay Monthly WebsitesWebsites Unlimited - Pay Monthly Websites
Websites Unlimited - Pay Monthly Websiteswebsiteunlimited
 
Drupal Camp Victoria
Drupal Camp VictoriaDrupal Camp Victoria
Drupal Camp VictoriaImage X Media
 
Company Visitor Management System Report.docx
Company Visitor Management System Report.docxCompany Visitor Management System Report.docx
Company Visitor Management System Report.docxfantabulous2024
 
Web Development From the Ground Up, a Series for Novice ...
Web Development From the Ground Up, a Series for Novice ...Web Development From the Ground Up, a Series for Novice ...
Web Development From the Ground Up, a Series for Novice ...webhostingguy
 
Using rest to create responsive html 5 share point intranets
Using rest to create responsive html 5 share point intranetsUsing rest to create responsive html 5 share point intranets
Using rest to create responsive html 5 share point intranetsInnoTech
 
Web UI migration
Web UI migrationWeb UI migration
Web UI migrationDoug Lucy
 
Fundamentals of web_design_v2
Fundamentals of web_design_v2Fundamentals of web_design_v2
Fundamentals of web_design_v2hussain534
 
Hadoop World 2011: Building Web Analytics Processing on Hadoop at CBS Interac...
Hadoop World 2011: Building Web Analytics Processing on Hadoop at CBS Interac...Hadoop World 2011: Building Web Analytics Processing on Hadoop at CBS Interac...
Hadoop World 2011: Building Web Analytics Processing on Hadoop at CBS Interac...Cloudera, Inc.
 
Cakefest higher education
Cakefest higher educationCakefest higher education
Cakefest higher educationtherealphpdiddy
 
JBUG 11 - Django-The Web Framework For Perfectionists With Deadlines
JBUG 11 - Django-The Web Framework For Perfectionists With DeadlinesJBUG 11 - Django-The Web Framework For Perfectionists With Deadlines
JBUG 11 - Django-The Web Framework For Perfectionists With DeadlinesTikal Knowledge
 

Similar to PDF Generation in Rails with Prawn and Prawn-to: John McCaffrey (20)

Implementing Structured FrameMaker
Implementing Structured FrameMakerImplementing Structured FrameMaker
Implementing Structured FrameMaker
 
Markdown - friend or foe?
Markdown - friend or foe?Markdown - friend or foe?
Markdown - friend or foe?
 
Tcs3 stc creating e pub and apps with tcs3
Tcs3 stc creating e pub and apps with tcs3Tcs3 stc creating e pub and apps with tcs3
Tcs3 stc creating e pub and apps with tcs3
 
1 Introduction to Drupal Web Development
1 Introduction to Drupal Web Development1 Introduction to Drupal Web Development
1 Introduction to Drupal Web Development
 
Websites Unlimited - Pay Monthly Websites
Websites Unlimited - Pay Monthly WebsitesWebsites Unlimited - Pay Monthly Websites
Websites Unlimited - Pay Monthly Websites
 
How to reduce DTP and translation costs with FrameMaker
How to reduce DTP and translation costs with FrameMakerHow to reduce DTP and translation costs with FrameMaker
How to reduce DTP and translation costs with FrameMaker
 
Drupal Camp Victoria
Drupal Camp VictoriaDrupal Camp Victoria
Drupal Camp Victoria
 
Company Visitor Management System Report.docx
Company Visitor Management System Report.docxCompany Visitor Management System Report.docx
Company Visitor Management System Report.docx
 
Web Development From the Ground Up, a Series for Novice ...
Web Development From the Ground Up, a Series for Novice ...Web Development From the Ground Up, a Series for Novice ...
Web Development From the Ground Up, a Series for Novice ...
 
Using rest to create responsive html 5 share point intranets
Using rest to create responsive html 5 share point intranetsUsing rest to create responsive html 5 share point intranets
Using rest to create responsive html 5 share point intranets
 
Web UI migration
Web UI migrationWeb UI migration
Web UI migration
 
Fundamentals of web_design_v2
Fundamentals of web_design_v2Fundamentals of web_design_v2
Fundamentals of web_design_v2
 
Hadoop World 2011: Building Web Analytics Processing on Hadoop at CBS Interac...
Hadoop World 2011: Building Web Analytics Processing on Hadoop at CBS Interac...Hadoop World 2011: Building Web Analytics Processing on Hadoop at CBS Interac...
Hadoop World 2011: Building Web Analytics Processing on Hadoop at CBS Interac...
 
Apex RnD APEX 5 - Printing
Apex RnD APEX 5 - PrintingApex RnD APEX 5 - Printing
Apex RnD APEX 5 - Printing
 
Cakefest higher education
Cakefest higher educationCakefest higher education
Cakefest higher education
 
The Trip to DITA
The Trip to DITAThe Trip to DITA
The Trip to DITA
 
Google Docs for Researchers: Creating, Editing, And Sharing Your Work Online
Google Docs for Researchers: Creating, Editing, And Sharing Your Work OnlineGoogle Docs for Researchers: Creating, Editing, And Sharing Your Work Online
Google Docs for Researchers: Creating, Editing, And Sharing Your Work Online
 
Production and Distribution of Digital Content
Production and Distribution of Digital ContentProduction and Distribution of Digital Content
Production and Distribution of Digital Content
 
Hadoop basics
Hadoop basicsHadoop basics
Hadoop basics
 
JBUG 11 - Django-The Web Framework For Perfectionists With Deadlines
JBUG 11 - Django-The Web Framework For Perfectionists With DeadlinesJBUG 11 - Django-The Web Framework For Perfectionists With Deadlines
JBUG 11 - Django-The Web Framework For Perfectionists With Deadlines
 

More from John McCaffrey

A Taste of TDD: The basics of TDD, why it is hard and how to do it better
A Taste of TDD: The basics of TDD, why it is hard and how to do it betterA Taste of TDD: The basics of TDD, why it is hard and how to do it better
A Taste of TDD: The basics of TDD, why it is hard and how to do it betterJohn McCaffrey
 
Becoming a more Productive Rails Developer
Becoming a more Productive Rails DeveloperBecoming a more Productive Rails Developer
Becoming a more Productive Rails DeveloperJohn McCaffrey
 
LeanStartup:Research is cheaper than development
LeanStartup:Research is cheaper than developmentLeanStartup:Research is cheaper than development
LeanStartup:Research is cheaper than developmentJohn McCaffrey
 
Becoming a more productive Rails Developer
Becoming a more productive Rails DeveloperBecoming a more productive Rails Developer
Becoming a more productive Rails DeveloperJohn McCaffrey
 
Windycityrails page performance
Windycityrails page performanceWindycityrails page performance
Windycityrails page performanceJohn McCaffrey
 
Freelancing and side-projects on Rails
Freelancing and side-projects on RailsFreelancing and side-projects on Rails
Freelancing and side-projects on RailsJohn McCaffrey
 
Cvcc performance tuning
Cvcc performance tuningCvcc performance tuning
Cvcc performance tuningJohn McCaffrey
 
Ruby on Rails Performance Tuning. Make it faster, make it better (WindyCityRa...
Ruby on Rails Performance Tuning. Make it faster, make it better (WindyCityRa...Ruby on Rails Performance Tuning. Make it faster, make it better (WindyCityRa...
Ruby on Rails Performance Tuning. Make it faster, make it better (WindyCityRa...John McCaffrey
 
Windy cityrails performance_tuning
Windy cityrails performance_tuningWindy cityrails performance_tuning
Windy cityrails performance_tuningJohn McCaffrey
 
improving the performance of Rails web Applications
improving the performance of Rails web Applicationsimproving the performance of Rails web Applications
improving the performance of Rails web ApplicationsJohn McCaffrey
 

More from John McCaffrey (13)

John's Sample
John's SampleJohn's Sample
John's Sample
 
A Taste of TDD: The basics of TDD, why it is hard and how to do it better
A Taste of TDD: The basics of TDD, why it is hard and how to do it betterA Taste of TDD: The basics of TDD, why it is hard and how to do it better
A Taste of TDD: The basics of TDD, why it is hard and how to do it better
 
Becoming a more Productive Rails Developer
Becoming a more Productive Rails DeveloperBecoming a more Productive Rails Developer
Becoming a more Productive Rails Developer
 
LeanStartup:Research is cheaper than development
LeanStartup:Research is cheaper than developmentLeanStartup:Research is cheaper than development
LeanStartup:Research is cheaper than development
 
Becoming a more productive Rails Developer
Becoming a more productive Rails DeveloperBecoming a more productive Rails Developer
Becoming a more productive Rails Developer
 
Cloud tools
Cloud toolsCloud tools
Cloud tools
 
Windycityrails page performance
Windycityrails page performanceWindycityrails page performance
Windycityrails page performance
 
Irb Tips and Tricks
Irb Tips and TricksIrb Tips and Tricks
Irb Tips and Tricks
 
Freelancing and side-projects on Rails
Freelancing and side-projects on RailsFreelancing and side-projects on Rails
Freelancing and side-projects on Rails
 
Cvcc performance tuning
Cvcc performance tuningCvcc performance tuning
Cvcc performance tuning
 
Ruby on Rails Performance Tuning. Make it faster, make it better (WindyCityRa...
Ruby on Rails Performance Tuning. Make it faster, make it better (WindyCityRa...Ruby on Rails Performance Tuning. Make it faster, make it better (WindyCityRa...
Ruby on Rails Performance Tuning. Make it faster, make it better (WindyCityRa...
 
Windy cityrails performance_tuning
Windy cityrails performance_tuningWindy cityrails performance_tuning
Windy cityrails performance_tuning
 
improving the performance of Rails web Applications
improving the performance of Rails web Applicationsimproving the performance of Rails web Applications
improving the performance of Rails web Applications
 

Recently uploaded

Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesBoston Institute of Analytics
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfhans926745
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 

Recently uploaded (20)

Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 

PDF Generation in Rails with Prawn and Prawn-to: John McCaffrey

Editor's Notes

  1. What I want you to walk away with: an understanding of the types of libraries out there, and the general strengths/weaknesses of each What prawn can and can’t do General pdf testing techniques some advanced examples and libraries
  2. Ask them to turn in and introduce them selves to at least one new person Bring up the ‘Used it’, ‘Still Using it’ papers
  3. PDFs are the defacto standard for reports, invoices and print friendly documents Sometimes its just easier than making the HTML print friendly The Pdf spec is quite large and complicated, you can do a lot with pdfs. One of the projects we had a Pathfinder was a PDF annotation tool for the Construction space But today I’m going to focus on the more common uses of PDF, for reports and basic print-friendly content
  4. Not all PDFs are created equally. When I started looking into PDF generation in ruby I had some basic requirements, but pdfs can be complicated, and not all the tools will handle your needs. Let’s take a look at what’s out there
  5. To me the libraries fall in three main categories Taking rendered html and converting or printing it as a pdf Creating a static pdf file and binding data against it Writing the code that creates the pdf components from scratch (now there are other pdf manipulation tools out there, but we’re talking about creation, not editing)
  6. Show example of kocg form, bluebook blueprint, Mention that the library may be os specific which could affect the deployment process
  7. May also depend on the team skills While its great to be able to reuse something you’ve already built, its pretty common to want the PDFs to have some additional element, be it security styling, etc
  8. Get more details of these types Just because a library is commercial doesn’t mean you shouldn’t use it. Evaluate the true cost of your time In the case of HTMLDOC, its not like you are taking your full site and instantly getting pdfs out of it. Mostly you will be altering your view or creating a second view that looks the way you want it without external css. Htmlconverter – haven’t used it http:// github.com/dcu/htmlconverter/tree/master Pd4ml - http:// www.extonrails.com/?q =node/26 similar to prince, but costs less
  9. Show example of kocg form. Now this is an example of a pdf that is better suited in the template style, but we’re going to be focusing more on regular reporting style pdfs
  10. What other libraries are there to do this? Both pdftk and iText go beyond just template binding. They are great libraries and if you are not looking for an open source, but not necessarily pure-ruby solution, you should check them out Is pdftk tcl based? Pragmatic uses iText to insert the ‘this book licensed only to Darth Vader’ footer
  11. You want to be mindful of the document size, because you are building so much. Not sure if there is any way to cache fragments. Prawn-to has a concept of compiled templates, but I’m not sure what that’s about
  12. http://www.cnblogs.com/hardrock/archive/2006/07/24/458184.html RubyFpdf – php port Pdflib and rfpdf wrapper for it Does jasper reports just call out to iText? What about Flyingsaucer java How much faster is prawn than pdf writer? 40 times? And even faster on ruby 1.9
  13. Prawn seemed to be the only one that had good test coverage
  14. RBP will go creative-commons free in march 2010 Ruport is an interesting framework, and if you have to output reports in more than one format (csv, html, pdf) you should take a look at it. Currently the pdf side of it isn’t using prawn under the covers, but it will be soon
  15. For positioning: you create your bounding box, then do all commands relative to that space Prawn was good for me, and depending on what you are doing, there’s a good chance it will be good for you too. Let’s take a look under the hood and see what it can do. Even if you feel that Prawn is not the right library for you, I’m hoping you’ll still get some good ideas for general pdf structure, testing and maintenance Prawn is moving fast, and there are a lot of related sub projects going on. So while it might not cover your needs right now, there’s a good chance it will soon, so keep an eye out.
  16. Show a screen shot of the tests passing
  17. Text – type it out and show how simple the initial syntax is Images – show just local file images first Bounding box – show the relative coordinates, and how easy it is Overflow – show how the page flow is taken care of Orientation – show landscape, portrait, and mixing the two within a document (how does that print?)
  18. http://groups.google.com/group/pdf-writer/browse_thread/thread/5bc8de74e1a7d3c5 Groupon recently started using prawn to render the coupons, and they were able to get a good looking first cut in less than a day, and finished the final version pretty quickly They are using prawn in production to serve up over 8k pdfs a day Most of the pdfs I’ve shown you today are generated in less than 3 secods
  19. Also mention image comparisons like bluebook
  20. Also mention image comparisons like bluebook
  21. http://cracklabs.com/prawnto/
  22. Using prawn-to can help you stick to a pure MVC pattern, and not jumbling too much logic into the pdf creation
  23. When it becomes easy to make pdfs, you can start to see creative things you never would have before
  24. Now you might not want to call out to a 3 rd party for charts in production, but using google charts can allow you to make a quick prototype and move from concept to delivery faster
  25. Great way to leverage your existing style concepts Make a script to parse css file and register those styles No support for div or table
  26. Is susan Potter here? Sorry for not using twitter4r, it looks great, but I just found this one first I have this up at prawn.heroku.com, but I’m having an issue with one of the gems at the moment
  27. Prawn-js for scripting within the pdf http://github.com/yob/prawn-js/tree/master http:// wiki.github.com /sandal/prawn/development-roadmap