SlideShare a Scribd company logo
1 of 37
© 2015, iText Group NV, iText Software Corp., iText Software BVBA© 2015, iText Group NV, iText Software Corp., iText Software BVBA
ETDA, INBATEK & iText Conference
Bangkok, July 27, 2017
© 2015, iText Group NV, iText Software Corp., iText Software BVBA
Three major ways to create PDF
From scratch using iText objects:
Paragraph, Text, Table, Cell, List,…
Advantage: everything is programmable, hence configurable just the way you want it,
Disadvantage: you need to program everything; small changes need programming.
Using an existing template:
AcroForm technology: fast, easy, but not dynamic (all fields have fixed positions),
XFA technology: dynamic, filling is easy, but form creation is complex, deprecated in PDF 2.0!
By converting HTML + CSS to PDF:
Everyone knows HTML! Everyone knows CSS!
Why would you create a template in another (proprietary?) format?
Create content in HTML, convert to PDF with pdfHTML.
HTML to PDF conversion with pdfHTML2
© 2015, iText Group NV, iText Software Corp., iText Software BVBA© 2015, iText Group NV, iText Software Corp., iText Software BVBA
CSS examples
 No CSS,
 Inline CSS,
 Header CSS,
 External CSS.
© 2015, iText Group NV, iText Software Corp., iText Software BVBA
No CSS: HTML + pdfHTML code
HTML to PDF conversion with pdfHTML4
© 2015, iText Group NV, iText Software Corp., iText Software BVBA
No CSS: result
HTML to PDF conversion with pdfHTML5
© 2015, iText Group NV, iText Software Corp., iText Software BVBA
Inline CSS: HTML + pdfHTML code
HTML to PDF conversion with pdfHTML6
© 2015, iText Group NV, iText Software Corp., iText Software BVBA
Inline CSS: result
HTML to PDF conversion with pdfHTML7
© 2015, iText Group NV, iText Software Corp., iText Software BVBA
Header CSS: HTML + pdfHTML code
HTML to PDF conversion with pdfHTML8
© 2015, iText Group NV, iText Software Corp., iText Software BVBA
Header CSS: result
HTML to PDF conversion with pdfHTML9
© 2015, iText Group NV, iText Software Corp., iText Software BVBA
External CSS: HTML + pdfHTML code
HTML to PDF conversion with pdfHTML10
© 2015, iText Group NV, iText Software Corp., iText Software BVBA
External CSS: result
HTML to PDF conversion with pdfHTML11
© 2015, iText Group NV, iText Software Corp., iText Software BVBA
Adding a background
HTML to PDF conversion with pdfHTML12
© 2015, iText Group NV, iText Software Corp., iText Software BVBA
Background
HTML to PDF conversion with pdfHTML13
© 2015, iText Group NV, iText Software Corp., iText Software BVBA
Use in the context of pdfHTML
Other convertToPdf() method: FileInputStream and PdfDocument
Why do we need ConverterProperties?
HTML to PDF conversion with pdfHTML14
© 2015, iText Group NV, iText Software Corp., iText Software BVBA© 2015, iText Group NV, iText Software Corp., iText Software BVBA
Use case: invoices
For every customer you need:
 Raw data that can be converted to simple HTML
 A customer-provided CSS to apply styles
 A customer-provided PDF as company stationery
© 2015, iText Group NV, iText Software Corp., iText Software BVBA
ZUGFeRD examples
HTML to PDF conversion with pdfHTML16
© 2015, iText Group NV, iText Software Corp., iText Software BVBA© 2015, iText Group NV, iText Software Corp., iText Software BVBA
Responsiveness: HTML vs PDF
© 2015, iText Group NV, iText Software Corp., iText Software BVBA
HTML and different devices
When creating an HTML + CSS file, you don’t always know how it will be viewed:
HTML to PDF conversion with pdfHTML18
© 2015, iText Group NV, iText Software Corp., iText Software BVBA
HTML and different devices
The content can be rendered differently based on the device:
Header, main, left and right pane can be reorganized based on available space
Navigation can be different on different devices
Orientation can change (e.g. turn tablet from portrait to landscape)
You can change the rendering based on Media Queries
Change font, widths, image size, positions,…
 Desktop screens: horizontal placement, smaller font-size,…
 Mobile screen: larger font size, vertical flow,…
 Print: hide interactive and animated features, use less color,…
HTML to PDF conversion with pdfHTML19
© 2015, iText Group NV, iText Software Corp., iText Software BVBA
Example HTML
HTML to PDF conversion with pdfHTML20
© 2015, iText Group NV, iText Software Corp., iText Software BVBA
Example HTML
HTML to PDF conversion with pdfHTML21
© 2015, iText Group NV, iText Software Corp., iText Software BVBA
Media Queries in CSS
HTML to PDF conversion with pdfHTML22
© 2015, iText Group NV, iText Software Corp., iText Software BVBA
The problem with PDF on devices
HTML to PDF conversion with pdfHTML23
© 2015, iText Group NV, iText Software Corp., iText Software BVBA
Convert to different PDFs
HTML to PDF conversion with pdfHTML24
© 2015, iText Group NV, iText Software Corp., iText Software BVBA
Defining different page sizes
HTML to PDF conversion with pdfHTML25
Introducing:
Tagging
Page sizes
Media Device Description
Create form
© 2015, iText Group NV, iText Software Corp., iText Software BVBA© 2015, iText Group NV, iText Software Corp., iText Software BVBA
Create your own tags
© 2015, iText Group NV, iText Software Corp., iText Software BVBA
Tags student and date don’t exist
HTML to PDF conversion with pdfHTML27
© 2015, iText Group NV, iText Software Corp., iText Software BVBA
Extend the tag factory
HTML to PDF conversion with pdfHTML28
© 2015, iText Group NV, iText Software Corp., iText Software BVBA
Custom tags: custom functionality
HTML to PDF conversion with pdfHTML29
© 2015, iText Group NV, iText Software Corp., iText Software BVBA
CSS applier needed
More elaborate example: QR Code
QRCodeTagCssApplierFactory extends DefaultCssApplierFactory
QRCodeTagWorkerFactory extends DefaultTagWorkerFactory
QRCodeTagWorker implements ITagWorker
HTML to PDF conversion with pdfHTML30
© 2015, iText Group NV, iText Software Corp., iText Software BVBA
HTML + CSS => PDF
HTML to PDF conversion with pdfHTML31
© 2015, iText Group NV, iText Software Corp., iText Software BVBA© 2015, iText Group NV, iText Software Corp., iText Software BVBA
iText DITO
Under development
© 2015, iText Group NV, iText Software Corp., iText Software BVBA
Design Interactive Templates Online
33 HTML to PDF conversion with pdfHTML
© 2015, iText Group NV, iText Software Corp., iText Software BVBA
Design Interactive Templates Online
34 HTML to PDF conversion with pdfHTML
© 2015, iText Group NV, iText Software Corp., iText Software BVBA
pdfHTML
Tyrion Server
Data
HTML / CSSTemplate PDF
Tyrion
Designer
SQL
JSON
XML
...
Web application
WYSIWYG
Subset HTML
Subset Bootstrap
Data connections
PDF
PDF/A
PDF/U
A
...
Tyrion SDK
Interactive
form
Web form
via web
browser
Request
and submit
data
Front end
Back end
HTML to PDF conversion with pdfHTML35
© 2015, iText Group NV, iText Software Corp., iText Software BVBA
pdfHTML
Tyrion Server
Data
HTML / CSSTemplate PDF
Tyrion
Designer
SQL
JSON
XML
...
Web application
WYSIWYG
Subset HTML
Subset Bootstrap
Data connections
PDF
PDF/A
PDF/U
A
...
Tyrion SDK
Interactive
form
Web form
via web
browser
Request
and submit
data
Front end
Back end
<Name>
<Address>
<Invoice items table
(4 cols, headers, ...)>
<Total>
<Name>
<Address>
item qty price tot
<Item> <Qty> <Price> <Tot>
<Item> <Qty> <Price> <Tot>
<Total>.
Raf Hens
Kerkstraat 108
9050 Gentbrugge
item qty price tot
Item A 4 100 400
Item B 1 10 10
Item C 17 45 765
Item D 2 50 100
Item E 1 70 70
Item F 4 250 1000
Item G 5 100 500
Item H 12 3 36
Item I 1 100 100
Item J 1 35 35
Item K 1 250 250
3266.
Raf Hens
Kerkstraat 108
9050 Gentbrugge
item qty price tot
Item A 4 100 400
Item B 1 10 10
Item C 17 45 765
Item D 2 50 100
Item E 1 70 70
Item F 4 250 1000
Item G 5 100 500
p 1/2
item qty price tot
Item H 12 3 36
Item I 1 100 100
Item J 1 35 35
Item K 1 250 250
3266.
p 2/2
HTML to PDF conversion with pdfHTML36
© 2015, iText Group NV, iText Software Corp., iText Software BVBA© 2015, iText Group NV, iText Software Corp., iText Software BVBA
Thank you!

More Related Content

More from iText Group nv

PDF made easy with iText 7
PDF made easy with iText 7PDF made easy with iText 7
PDF made easy with iText 7iText Group nv
 
Start-ups: the tortoise and the hare
Start-ups: the tortoise and the hareStart-ups: the tortoise and the hare
Start-ups: the tortoise and the hareiText Group nv
 
IANAL: what developers should know about IP and Legal
IANAL: what developers should know about IP and LegalIANAL: what developers should know about IP and Legal
IANAL: what developers should know about IP and LegaliText Group nv
 
Digital Signatures in the Cloud: A B2C Case Study
Digital Signatures in the Cloud: A B2C Case StudyDigital Signatures in the Cloud: A B2C Case Study
Digital Signatures in the Cloud: A B2C Case StudyiText Group nv
 
Digital Signatures: how it's done in PDF
Digital Signatures: how it's done in PDFDigital Signatures: how it's done in PDF
Digital Signatures: how it's done in PDFiText Group nv
 
PDF is dead. Long live PDF... with Java!
PDF is dead. Long live PDF... with Java!PDF is dead. Long live PDF... with Java!
PDF is dead. Long live PDF... with Java!iText Group nv
 
Digital Signatures: how it's done in PDF
Digital Signatures: how it's done in PDFDigital Signatures: how it's done in PDF
Digital Signatures: how it's done in PDFiText Group nv
 
iText Summit 2014: Talk: iText throughout the document life cycle
iText Summit 2014: Talk: iText throughout the document life cycleiText Summit 2014: Talk: iText throughout the document life cycle
iText Summit 2014: Talk: iText throughout the document life cycleiText Group nv
 
iText Summit 2014: Keynote talk
iText Summit 2014: Keynote talkiText Summit 2014: Keynote talk
iText Summit 2014: Keynote talkiText Group nv
 
iText Summit 2014: Talk: eGriffie and JustX, introducing digital documents at...
iText Summit 2014: Talk: eGriffie and JustX, introducing digital documents at...iText Summit 2014: Talk: eGriffie and JustX, introducing digital documents at...
iText Summit 2014: Talk: eGriffie and JustX, introducing digital documents at...iText Group nv
 
The XML Forms Architecture
The XML Forms ArchitectureThe XML Forms Architecture
The XML Forms ArchitectureiText Group nv
 
Damn, the new generation kids are getting iPads in Highschool!
Damn, the new generation kids are getting iPads in Highschool!Damn, the new generation kids are getting iPads in Highschool!
Damn, the new generation kids are getting iPads in Highschool!iText Group nv
 
PAdES signatures in iText and the road ahead
PAdES signatures in iText and the road aheadPAdES signatures in iText and the road ahead
PAdES signatures in iText and the road aheadiText Group nv
 
Best practices in Certifying and Signing PDFs
Best practices in Certifying and Signing PDFsBest practices in Certifying and Signing PDFs
Best practices in Certifying and Signing PDFsiText Group nv
 
Choosing the iText Solution that is right for you: Community or Commercial ed...
Choosing the iText Solution that is right for you: Community or Commercial ed...Choosing the iText Solution that is right for you: Community or Commercial ed...
Choosing the iText Solution that is right for you: Community or Commercial ed...iText Group nv
 
The importance of standards
The importance of standardsThe importance of standards
The importance of standardsiText Group nv
 

More from iText Group nv (17)

PDF made easy with iText 7
PDF made easy with iText 7PDF made easy with iText 7
PDF made easy with iText 7
 
Start-ups: the tortoise and the hare
Start-ups: the tortoise and the hareStart-ups: the tortoise and the hare
Start-ups: the tortoise and the hare
 
IANAL: what developers should know about IP and Legal
IANAL: what developers should know about IP and LegalIANAL: what developers should know about IP and Legal
IANAL: what developers should know about IP and Legal
 
Digital Signatures in the Cloud: A B2C Case Study
Digital Signatures in the Cloud: A B2C Case StudyDigital Signatures in the Cloud: A B2C Case Study
Digital Signatures in the Cloud: A B2C Case Study
 
Digital Signatures: how it's done in PDF
Digital Signatures: how it's done in PDFDigital Signatures: how it's done in PDF
Digital Signatures: how it's done in PDF
 
ZUGFeRD: an overview
ZUGFeRD: an overviewZUGFeRD: an overview
ZUGFeRD: an overview
 
PDF is dead. Long live PDF... with Java!
PDF is dead. Long live PDF... with Java!PDF is dead. Long live PDF... with Java!
PDF is dead. Long live PDF... with Java!
 
Digital Signatures: how it's done in PDF
Digital Signatures: how it's done in PDFDigital Signatures: how it's done in PDF
Digital Signatures: how it's done in PDF
 
iText Summit 2014: Talk: iText throughout the document life cycle
iText Summit 2014: Talk: iText throughout the document life cycleiText Summit 2014: Talk: iText throughout the document life cycle
iText Summit 2014: Talk: iText throughout the document life cycle
 
iText Summit 2014: Keynote talk
iText Summit 2014: Keynote talkiText Summit 2014: Keynote talk
iText Summit 2014: Keynote talk
 
iText Summit 2014: Talk: eGriffie and JustX, introducing digital documents at...
iText Summit 2014: Talk: eGriffie and JustX, introducing digital documents at...iText Summit 2014: Talk: eGriffie and JustX, introducing digital documents at...
iText Summit 2014: Talk: eGriffie and JustX, introducing digital documents at...
 
The XML Forms Architecture
The XML Forms ArchitectureThe XML Forms Architecture
The XML Forms Architecture
 
Damn, the new generation kids are getting iPads in Highschool!
Damn, the new generation kids are getting iPads in Highschool!Damn, the new generation kids are getting iPads in Highschool!
Damn, the new generation kids are getting iPads in Highschool!
 
PAdES signatures in iText and the road ahead
PAdES signatures in iText and the road aheadPAdES signatures in iText and the road ahead
PAdES signatures in iText and the road ahead
 
Best practices in Certifying and Signing PDFs
Best practices in Certifying and Signing PDFsBest practices in Certifying and Signing PDFs
Best practices in Certifying and Signing PDFs
 
Choosing the iText Solution that is right for you: Community or Commercial ed...
Choosing the iText Solution that is right for you: Community or Commercial ed...Choosing the iText Solution that is right for you: Community or Commercial ed...
Choosing the iText Solution that is right for you: Community or Commercial ed...
 
The importance of standards
The importance of standardsThe importance of standards
The importance of standards
 

Recently uploaded

SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 

Recently uploaded (20)

SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 

ETDA Conference - HTML to PDF conversion with pdfHTML

  • 1. © 2015, iText Group NV, iText Software Corp., iText Software BVBA© 2015, iText Group NV, iText Software Corp., iText Software BVBA ETDA, INBATEK & iText Conference Bangkok, July 27, 2017
  • 2. © 2015, iText Group NV, iText Software Corp., iText Software BVBA Three major ways to create PDF From scratch using iText objects: Paragraph, Text, Table, Cell, List,… Advantage: everything is programmable, hence configurable just the way you want it, Disadvantage: you need to program everything; small changes need programming. Using an existing template: AcroForm technology: fast, easy, but not dynamic (all fields have fixed positions), XFA technology: dynamic, filling is easy, but form creation is complex, deprecated in PDF 2.0! By converting HTML + CSS to PDF: Everyone knows HTML! Everyone knows CSS! Why would you create a template in another (proprietary?) format? Create content in HTML, convert to PDF with pdfHTML. HTML to PDF conversion with pdfHTML2
  • 3. © 2015, iText Group NV, iText Software Corp., iText Software BVBA© 2015, iText Group NV, iText Software Corp., iText Software BVBA CSS examples  No CSS,  Inline CSS,  Header CSS,  External CSS.
  • 4. © 2015, iText Group NV, iText Software Corp., iText Software BVBA No CSS: HTML + pdfHTML code HTML to PDF conversion with pdfHTML4
  • 5. © 2015, iText Group NV, iText Software Corp., iText Software BVBA No CSS: result HTML to PDF conversion with pdfHTML5
  • 6. © 2015, iText Group NV, iText Software Corp., iText Software BVBA Inline CSS: HTML + pdfHTML code HTML to PDF conversion with pdfHTML6
  • 7. © 2015, iText Group NV, iText Software Corp., iText Software BVBA Inline CSS: result HTML to PDF conversion with pdfHTML7
  • 8. © 2015, iText Group NV, iText Software Corp., iText Software BVBA Header CSS: HTML + pdfHTML code HTML to PDF conversion with pdfHTML8
  • 9. © 2015, iText Group NV, iText Software Corp., iText Software BVBA Header CSS: result HTML to PDF conversion with pdfHTML9
  • 10. © 2015, iText Group NV, iText Software Corp., iText Software BVBA External CSS: HTML + pdfHTML code HTML to PDF conversion with pdfHTML10
  • 11. © 2015, iText Group NV, iText Software Corp., iText Software BVBA External CSS: result HTML to PDF conversion with pdfHTML11
  • 12. © 2015, iText Group NV, iText Software Corp., iText Software BVBA Adding a background HTML to PDF conversion with pdfHTML12
  • 13. © 2015, iText Group NV, iText Software Corp., iText Software BVBA Background HTML to PDF conversion with pdfHTML13
  • 14. © 2015, iText Group NV, iText Software Corp., iText Software BVBA Use in the context of pdfHTML Other convertToPdf() method: FileInputStream and PdfDocument Why do we need ConverterProperties? HTML to PDF conversion with pdfHTML14
  • 15. © 2015, iText Group NV, iText Software Corp., iText Software BVBA© 2015, iText Group NV, iText Software Corp., iText Software BVBA Use case: invoices For every customer you need:  Raw data that can be converted to simple HTML  A customer-provided CSS to apply styles  A customer-provided PDF as company stationery
  • 16. © 2015, iText Group NV, iText Software Corp., iText Software BVBA ZUGFeRD examples HTML to PDF conversion with pdfHTML16
  • 17. © 2015, iText Group NV, iText Software Corp., iText Software BVBA© 2015, iText Group NV, iText Software Corp., iText Software BVBA Responsiveness: HTML vs PDF
  • 18. © 2015, iText Group NV, iText Software Corp., iText Software BVBA HTML and different devices When creating an HTML + CSS file, you don’t always know how it will be viewed: HTML to PDF conversion with pdfHTML18
  • 19. © 2015, iText Group NV, iText Software Corp., iText Software BVBA HTML and different devices The content can be rendered differently based on the device: Header, main, left and right pane can be reorganized based on available space Navigation can be different on different devices Orientation can change (e.g. turn tablet from portrait to landscape) You can change the rendering based on Media Queries Change font, widths, image size, positions,…  Desktop screens: horizontal placement, smaller font-size,…  Mobile screen: larger font size, vertical flow,…  Print: hide interactive and animated features, use less color,… HTML to PDF conversion with pdfHTML19
  • 20. © 2015, iText Group NV, iText Software Corp., iText Software BVBA Example HTML HTML to PDF conversion with pdfHTML20
  • 21. © 2015, iText Group NV, iText Software Corp., iText Software BVBA Example HTML HTML to PDF conversion with pdfHTML21
  • 22. © 2015, iText Group NV, iText Software Corp., iText Software BVBA Media Queries in CSS HTML to PDF conversion with pdfHTML22
  • 23. © 2015, iText Group NV, iText Software Corp., iText Software BVBA The problem with PDF on devices HTML to PDF conversion with pdfHTML23
  • 24. © 2015, iText Group NV, iText Software Corp., iText Software BVBA Convert to different PDFs HTML to PDF conversion with pdfHTML24
  • 25. © 2015, iText Group NV, iText Software Corp., iText Software BVBA Defining different page sizes HTML to PDF conversion with pdfHTML25 Introducing: Tagging Page sizes Media Device Description Create form
  • 26. © 2015, iText Group NV, iText Software Corp., iText Software BVBA© 2015, iText Group NV, iText Software Corp., iText Software BVBA Create your own tags
  • 27. © 2015, iText Group NV, iText Software Corp., iText Software BVBA Tags student and date don’t exist HTML to PDF conversion with pdfHTML27
  • 28. © 2015, iText Group NV, iText Software Corp., iText Software BVBA Extend the tag factory HTML to PDF conversion with pdfHTML28
  • 29. © 2015, iText Group NV, iText Software Corp., iText Software BVBA Custom tags: custom functionality HTML to PDF conversion with pdfHTML29
  • 30. © 2015, iText Group NV, iText Software Corp., iText Software BVBA CSS applier needed More elaborate example: QR Code QRCodeTagCssApplierFactory extends DefaultCssApplierFactory QRCodeTagWorkerFactory extends DefaultTagWorkerFactory QRCodeTagWorker implements ITagWorker HTML to PDF conversion with pdfHTML30
  • 31. © 2015, iText Group NV, iText Software Corp., iText Software BVBA HTML + CSS => PDF HTML to PDF conversion with pdfHTML31
  • 32. © 2015, iText Group NV, iText Software Corp., iText Software BVBA© 2015, iText Group NV, iText Software Corp., iText Software BVBA iText DITO Under development
  • 33. © 2015, iText Group NV, iText Software Corp., iText Software BVBA Design Interactive Templates Online 33 HTML to PDF conversion with pdfHTML
  • 34. © 2015, iText Group NV, iText Software Corp., iText Software BVBA Design Interactive Templates Online 34 HTML to PDF conversion with pdfHTML
  • 35. © 2015, iText Group NV, iText Software Corp., iText Software BVBA pdfHTML Tyrion Server Data HTML / CSSTemplate PDF Tyrion Designer SQL JSON XML ... Web application WYSIWYG Subset HTML Subset Bootstrap Data connections PDF PDF/A PDF/U A ... Tyrion SDK Interactive form Web form via web browser Request and submit data Front end Back end HTML to PDF conversion with pdfHTML35
  • 36. © 2015, iText Group NV, iText Software Corp., iText Software BVBA pdfHTML Tyrion Server Data HTML / CSSTemplate PDF Tyrion Designer SQL JSON XML ... Web application WYSIWYG Subset HTML Subset Bootstrap Data connections PDF PDF/A PDF/U A ... Tyrion SDK Interactive form Web form via web browser Request and submit data Front end Back end <Name> <Address> <Invoice items table (4 cols, headers, ...)> <Total> <Name> <Address> item qty price tot <Item> <Qty> <Price> <Tot> <Item> <Qty> <Price> <Tot> <Total>. Raf Hens Kerkstraat 108 9050 Gentbrugge item qty price tot Item A 4 100 400 Item B 1 10 10 Item C 17 45 765 Item D 2 50 100 Item E 1 70 70 Item F 4 250 1000 Item G 5 100 500 Item H 12 3 36 Item I 1 100 100 Item J 1 35 35 Item K 1 250 250 3266. Raf Hens Kerkstraat 108 9050 Gentbrugge item qty price tot Item A 4 100 400 Item B 1 10 10 Item C 17 45 765 Item D 2 50 100 Item E 1 70 70 Item F 4 250 1000 Item G 5 100 500 p 1/2 item qty price tot Item H 12 3 36 Item I 1 100 100 Item J 1 35 35 Item K 1 250 250 3266. p 2/2 HTML to PDF conversion with pdfHTML36
  • 37. © 2015, iText Group NV, iText Software Corp., iText Software BVBA© 2015, iText Group NV, iText Software Corp., iText Software BVBA Thank you!