SlideShare a Scribd company logo
1 of 32
PDF FORMS
YOONG KANG LIM
SYDJANGO
MARCH 2018
WE NEED YOUR APP TO
FILL IN A PDF FORM
”
“
CONTEXT
• Inherited Django + Cordova mobile app
• Mobile app sends data to Django app
• Invoice generated in PDF format
CONSTRAINTS
• Mobile app used once every sales cycle
• Invoices look totally different each sales cycle
• Client of client signs off on the invoice, we’re not allowed to change
how it looks
• Can’t standardise… customise every sales cycle
(NOT
ACTUALLY
THE
FORM)
WE WANT
THIS
IDEA #1:
LIBREOFFICE
LIBREOFFICE
• Programmatically interact with LibreOffice using Python via UNO
(unotools, PyUNO, etc)
• LibreOffice can create PDFs
• Sounds promising…
LIBREOFFICE
• Step 1: Convert the form into an image, and make that the
background of ODT document
• Step 2: Put in named fields and/or tables.
• Step 3: Use UNO and unotools to fill them in. For checkboxes,
somehow just put in a unicode check character into the right
field/table cell
• Step 4: Convert to PDF
PROBLEMS
• Generated invoice is in lower quality (compression) — client won’t
be happy
• Getting anything to align properly on LibreOffice is impossible
• Super annoying to do… we have 12 different invoices
• Heaps of problems getting UNO to work on later versions of
LibreOffice
IDEA #1.5
HTML-TO-PDF
PROBLEMS
• Couldn’t find a way to make the HTML/CSS/Fonts/etc look like the
invoice.
• Would have been nice otherwise
• Could also consider RML/ReportLab
IDEA #2
FDF
WHAT’S FDF?
• “Forms Data Format”
• Worst Wikipedia description ever:
FDF
• Basically, you can merge an FDF with a PDF form to get a filled-in
PDF form
• Libraries like fdfgen (https://github.com/ccnmtl/fdfgen) allow you to
generate FDF files from a Python dict
• You can use something called PDFtk to do the merging
PDFTK
PYPDFTK
• Tried out a library called PyPDFtk
(https://github.com/revolunet/pypdftk)
• It was great!
• Successfully filled in text fields
• Successfully selected radio buttons
• Successfully checked checkboxes
• ….Oh that’s right, we need a signature. Wait, image fields don’t
work!
IMAGES IN PDF
• It’s possible.
• Convert an image into PDF, making sure it’s positioned
appropriately
• Merge two pdfs together
• Luckily, I don’t have to implement this myself.
PDFJINJA
PUT JINJA2 VARIABLES IN TOOLTIP
ADOBE ACROBAT PRO DC
SIGNATURE WORKS!
PDFJINJA
CHECKBOXES/RADIO BUTTONS DON’T
PDFJINJA
PDFJINJA
• So, I had to fork PDFJinja
PDFJINJA
IT WORKED!
DEMO
WEIRD STUFF
• Remember PDFtk?
(https://stackoverflow.com/questions/23948647/font-issue-with-
pdftk)
FIX
WEIRD STUFF
SOME HELPFUL LINKS
THANKS!
• https://github.com/yoongkang/pdffun
• http://rammie.github.io/pdfjinja/
• https://www.pdflabs.com/tools/pdftk-server/
• https://github.com/revolunet/pypdftk

More Related Content

Similar to PDF Forms

DITA Proof-of-Concept Publishing System
DITA Proof-of-Concept Publishing SystemDITA Proof-of-Concept Publishing System
DITA Proof-of-Concept Publishing SystemMatso Limtiaco
 
Lava con 2011 amazon and apple publishing workshop2
Lava con 2011 amazon and apple publishing workshop2Lava con 2011 amazon and apple publishing workshop2
Lava con 2011 amazon and apple publishing workshop2Matt Sullivan
 
The Living Style Guide: How CustomInk created a their new ux lead style guide
The Living Style Guide: How CustomInk created a their new ux lead style guideThe Living Style Guide: How CustomInk created a their new ux lead style guide
The Living Style Guide: How CustomInk created a their new ux lead style guideDara Pressley
 
15 tips for bullet proof requirements analysis on SharePoint projects
15 tips for bullet proof requirements analysis on SharePoint projects15 tips for bullet proof requirements analysis on SharePoint projects
15 tips for bullet proof requirements analysis on SharePoint projectsDocFluix, LLC
 
Querix 4 gl app analyzer 2016 journey to the center of your 4gl application
Querix 4 gl app analyzer 2016 journey to the center of your 4gl applicationQuerix 4 gl app analyzer 2016 journey to the center of your 4gl application
Querix 4 gl app analyzer 2016 journey to the center of your 4gl applicationBeGooden-IT Consulting
 
Publshing to amazon kindle and apple i bookstore
Publshing to amazon kindle and apple i bookstorePublshing to amazon kindle and apple i bookstore
Publshing to amazon kindle and apple i bookstoreMatt Sullivan
 
Introduction to InfoPath 2010
Introduction to InfoPath 2010Introduction to InfoPath 2010
Introduction to InfoPath 2010Regroove
 
PDF in Lotus Notes applications
PDF in Lotus Notes applicationsPDF in Lotus Notes applications
PDF in Lotus Notes applicationsSWING Software
 
Creating an Interactive Book with iBooks Author #mLearnCon15
Creating an Interactive Book with iBooks Author #mLearnCon15Creating an Interactive Book with iBooks Author #mLearnCon15
Creating an Interactive Book with iBooks Author #mLearnCon15Nick Floro
 
HTML5 Is the Future of Book Authorship
HTML5 Is the Future of Book AuthorshipHTML5 Is the Future of Book Authorship
HTML5 Is the Future of Book AuthorshipSanders Kleinfeld
 
Github for Serious Business Professional
Github for Serious Business ProfessionalGithub for Serious Business Professional
Github for Serious Business Professionalzwheller
 
Developing mobile apps with f sharp
Developing mobile apps with f sharpDeveloping mobile apps with f sharp
Developing mobile apps with f sharpGustavo Guerra
 
IamLUG 2011: The Never Ending Integration Story: How to Integrate Your Lotus ...
IamLUG 2011: The Never Ending Integration Story: How to Integrate Your Lotus ...IamLUG 2011: The Never Ending Integration Story: How to Integrate Your Lotus ...
IamLUG 2011: The Never Ending Integration Story: How to Integrate Your Lotus ...John Head
 
Presentation1
Presentation1Presentation1
Presentation1f6aim
 
Rapid development of help files and user documentation in Dr.Explain 5
Rapid development of help files and user documentation in Dr.Explain 5Rapid development of help files and user documentation in Dr.Explain 5
Rapid development of help files and user documentation in Dr.Explain 5Dennis Zhuravlev (a.k.a. Crane)
 
Domino, Notes, and Verse - Where are We and Whats the Future?
Domino, Notes, and Verse - Where are We and Whats the Future?Domino, Notes, and Verse - Where are We and Whats the Future?
Domino, Notes, and Verse - Where are We and Whats the Future?Teamstudio
 
Office Integration for Lotus Notes Tutorial
Office Integration for Lotus Notes TutorialOffice Integration for Lotus Notes Tutorial
Office Integration for Lotus Notes TutorialSWING Software
 

Similar to PDF Forms (20)

DITA Proof-of-Concept Publishing System
DITA Proof-of-Concept Publishing SystemDITA Proof-of-Concept Publishing System
DITA Proof-of-Concept Publishing System
 
Lava con 2011 amazon and apple publishing workshop2
Lava con 2011 amazon and apple publishing workshop2Lava con 2011 amazon and apple publishing workshop2
Lava con 2011 amazon and apple publishing workshop2
 
The Living Style Guide: How CustomInk created a their new ux lead style guide
The Living Style Guide: How CustomInk created a their new ux lead style guideThe Living Style Guide: How CustomInk created a their new ux lead style guide
The Living Style Guide: How CustomInk created a their new ux lead style guide
 
15 tips for bullet proof requirements analysis on SharePoint projects
15 tips for bullet proof requirements analysis on SharePoint projects15 tips for bullet proof requirements analysis on SharePoint projects
15 tips for bullet proof requirements analysis on SharePoint projects
 
Querix 4 gl app analyzer 2016 journey to the center of your 4gl application
Querix 4 gl app analyzer 2016 journey to the center of your 4gl applicationQuerix 4 gl app analyzer 2016 journey to the center of your 4gl application
Querix 4 gl app analyzer 2016 journey to the center of your 4gl application
 
Publshing to amazon kindle and apple i bookstore
Publshing to amazon kindle and apple i bookstorePublshing to amazon kindle and apple i bookstore
Publshing to amazon kindle and apple i bookstore
 
Introduction to InfoPath 2010
Introduction to InfoPath 2010Introduction to InfoPath 2010
Introduction to InfoPath 2010
 
PDF in Lotus Notes applications
PDF in Lotus Notes applicationsPDF in Lotus Notes applications
PDF in Lotus Notes applications
 
Creating an Interactive Book with iBooks Author #mLearnCon15
Creating an Interactive Book with iBooks Author #mLearnCon15Creating an Interactive Book with iBooks Author #mLearnCon15
Creating an Interactive Book with iBooks Author #mLearnCon15
 
HTML5 Is the Future of Book Authorship
HTML5 Is the Future of Book AuthorshipHTML5 Is the Future of Book Authorship
HTML5 Is the Future of Book Authorship
 
Github for Serious Business Professional
Github for Serious Business ProfessionalGithub for Serious Business Professional
Github for Serious Business Professional
 
Developing mobile apps with f sharp
Developing mobile apps with f sharpDeveloping mobile apps with f sharp
Developing mobile apps with f sharp
 
IamLUG 2011: The Never Ending Integration Story: How to Integrate Your Lotus ...
IamLUG 2011: The Never Ending Integration Story: How to Integrate Your Lotus ...IamLUG 2011: The Never Ending Integration Story: How to Integrate Your Lotus ...
IamLUG 2011: The Never Ending Integration Story: How to Integrate Your Lotus ...
 
Demystifying DITA to PDF Publishing
Demystifying DITA to PDF PublishingDemystifying DITA to PDF Publishing
Demystifying DITA to PDF Publishing
 
Presentation1
Presentation1Presentation1
Presentation1
 
Rapid development of help files and user documentation in Dr.Explain 5
Rapid development of help files and user documentation in Dr.Explain 5Rapid development of help files and user documentation in Dr.Explain 5
Rapid development of help files and user documentation in Dr.Explain 5
 
Domino, Notes, and Verse - Where are We and Whats the Future?
Domino, Notes, and Verse - Where are We and Whats the Future?Domino, Notes, and Verse - Where are We and Whats the Future?
Domino, Notes, and Verse - Where are We and Whats the Future?
 
Office Integration for Lotus Notes Tutorial
Office Integration for Lotus Notes TutorialOffice Integration for Lotus Notes Tutorial
Office Integration for Lotus Notes Tutorial
 
SAP Adobe forms
SAP Adobe formsSAP Adobe forms
SAP Adobe forms
 
Oreilly
OreillyOreilly
Oreilly
 

Recently uploaded

Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - InfographicHr365.us smith
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
What are the features of Vehicle Tracking System?
What are the features of Vehicle Tracking System?What are the features of Vehicle Tracking System?
What are the features of Vehicle Tracking System?Watsoo Telematics
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Andreas Granig
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureDinusha Kumarasiri
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfkalichargn70th171
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number SystemsJheuzeDellosa
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmSujith Sukumaran
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyFrank van der Linden
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...aditisharan08
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxTier1 app
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 

Recently uploaded (20)

Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - Infographic
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
What are the features of Vehicle Tracking System?
What are the features of Vehicle Tracking System?What are the features of Vehicle Tracking System?
What are the features of Vehicle Tracking System?
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with Azure
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number Systems
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalm
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The Ugly
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 

PDF Forms