SlideShare a Scribd company logo
1 of 103
Download to read offline
© 2014, iText Group NV, iText Software Corp., iText Software BVBA© 2014, iText Group NV, iText Software Corp., iText Software BVBA
PDF is dead! Long live PDF!
Java One Tutorial 29/09/2014
© 2014, iText Group NV, iText Software Corp., iText Software BVBA
Is PDF dead?
PDF is dead; Long live PDF... and Java!2
© 2014, iText Group NV, iText Software Corp., iText Software BVBA
PDF is dead; Long live PDF... and Java!3
The PDF Reference Manual
© 2014, iText Group NV, iText Software Corp., iText Software BVBA
Everybody uses HTML
PDF is dead; Long live PDF... and Java!4
Source:
http://duff-johnson.com/2014/03/10/
98-percent-of-dot-com-is-html-but-38-percent-of-dot-gov-is-pdf/
© 2014, iText Group NV, iText Software Corp., iText Software BVBA
But governments also like PDF
PDF is dead; Long live PDF... and Java!5
Source:
http://duff-johnson.com/2014/03/10/
98-percent-of-dot-com-is-html-but-38-percent-of-dot-gov-is-pdf/
Percentage of PDF files:
.org: 15%
.gov: 38%
.edu: 27%
© 2014, iText Group NV, iText Software Corp., iText Software BVBA
Publications versus…
No need to be self-contained and may change over time
Not all content produced by the author
e.g. Advertisements
Becoming more interactive
e.g Comments on a news article
PDF is dead; Long live PDF... and Java!6
Source:
The Future of PDF
Leonard Rosenthol, PDF Architect at Adobe
© 2014, iText Group NV, iText Software Corp., iText Software BVBA
… documents
PDF is dead; Long live PDF... and Java!7
Source:
The Future of PDF
Leonard Rosenthol, PDF Architect at Adobe
Needs to be self-contained
Unchanging (non-dynamic)
Able to be authenticated
Able to be secured/protected
© 2014, iText Group NV, iText Software Corp., iText Software BVBA
Not counting HTML, PDF is King
PDF is dead; Long live PDF... and Java!8
Source:
http://duff-johnson.com/2014/02/17/
the-8-most-popular-document-formats-on-the-web/
© 2014, iText Group NV, iText Software Corp., iText Software BVBA
Challenges for PDF Challengers
Offline consumption
PDF Viewers are ubiquitous (Adobe Reader is on 90% of the desk tops)
Mobile consumption
Interactivity (forms, commenting,…)
Reading books on eReaders
Attacking the weaknesses of PDF
PDF suffers from “too much” functionality
PDF was designed in a “pre-hacker” world
Not all tools are created equal
• Producers don’t use best practices (e.g. Tagged PDF)
• Not all viewers support all features (e.g. EcmaScript)
PDF is dead; Long live PDF... and Java!9
© 2014, iText Group NV, iText Software Corp., iText Software BVBA
Umbrella of Standards
PDF is dead; Long live PDF... and Java!10
PDF
Portable Document Format
First released in 1993
ISO Standard since 2008
ISO 32000
PDF/E
engineering
Since 2008
ISO 24517
PDF/VT
printing
Since 2010
ISO 16612
PDF/X
graphic arts
Since 2001
ISO 15930
PDF/A
archive
Since 2005
ISO 19005
PDF/UA
accessibility
Since 2012
ISO 14289
Related:
• XFDF (ISO)
• EcmaScript (ISO)
• PRC (ISO)
• PAdES (ETSI)
© 2014, iText Group NV, iText Software Corp., iText Software BVBA© 2014, iText Group NV, iText Software Corp., iText Software BVBA
Hello iText
PDF is dead; Long live PDF... and Java!11
© 2014, iText Group NV, iText Software Corp., iText Software BVBA
Creating a PDF in 5 steps
Example 1: Hello World with iText
public void createPdf(String dest)
throws DocumentException, IOException {
// step 1
Document document = new Document();
// step 2
PdfWriter.getInstance(document, new FileOutputStream(dest));
// step 3
document.open();
// step 4
document.add(new Paragraph("Hello World!"));
// step 5
document.close();
}
PDF is dead; Long live PDF... and Java!12
© 2014, iText Group NV, iText Software Corp., iText Software BVBA
A “Hello World” PDF
PDF is dead; Long live PDF... and Java!13
© 2014, iText Group NV, iText Software Corp., iText Software BVBA
A simple form with three fields
PDF is dead; Long live PDF... and Java!14
Example : Filling out an existing form
© 2014, iText Group NV, iText Software Corp., iText Software BVBA
Filling out a form
Example 2.a: Filling out a form
public void manipulatePdf(String src, String dest)
throws DocumentException, IOException {
PdfReader reader = new PdfReader(src);
PdfStamper stamper =
new PdfStamper(reader, new FileOutputStream(dest));
AcroFields form = stamper.getAcroFields();
form.setField("Name", "Raf Hens");
form.setField("Company", "iText Software");
form.setField("Country", "BELGIUM");
stamper.close();
reader.close();
}
PDF is dead; Long live PDF... and Java!15
© 2014, iText Group NV, iText Software Corp., iText Software BVBA
A filled out form
PDF is dead; Long live PDF... and Java!16
© 2014, iText Group NV, iText Software Corp., iText Software BVBA
Flattening out a form
Example 2.b: Flattening a form
public void manipulatePdf(String src, String dest)
throws DocumentException, IOException {
PdfReader reader = new PdfReader(src);
PdfStamper stamper =
new PdfStamper(reader, new FileOutputStream(dest));
AcroFields form = stamper.getAcroFields();
form.setField("Name", "Bruno Lowagie");
form.setField("Company", "iText Group");
form.setField("Country", "BELGIUM");
stamper.setFormFlattening(true);
stamper.close();
reader.close();
}
PDF is dead; Long live PDF... and Java!17
© 2014, iText Group NV, iText Software Corp., iText Software BVBA
A flattened form
PDF is dead; Long live PDF... and Java!18
© 2014, iText Group NV, iText Software Corp., iText Software BVBA
Adding a watermark
Example 3: Stamping content on a PDF
public void manipulatePdf(String src, String dest)
throws DocumentException, IOException {
PdfReader reader = new PdfReader(src);
PdfStamper stamper =
new PdfStamper(reader, new FileOutputStream(dest));
PdfContentByte under = stamper.getUnderContent(1);
ColumnText.showTextAligned(under, Element.ALIGN_CENTER,
new Phrase("Watermark", new Font(FontFamily.HELVETICA, 120)),
297, 421, 45);
stamper.close();
reader.close();
}
PDF is dead; Long live PDF... and Java!19
© 2014, iText Group NV, iText Software Corp., iText Software BVBA© 2014, iText Group NV, iText Software Corp., iText Software BVBA
The importance of standards
Three use cases
© 2014, iText Group NV, iText Software Corp., iText Software BVBA
Speaking the same language
Not being able to understand each
other is a punishment, NOT a business
model!
Standards are about speaking the
same language!
PDF is dead; Long live PDF... and Java!21
© 2014, iText Group NV, iText Software Corp., iText Software BVBA© 2014, iText Group NV, iText Software Corp., iText Software BVBA
PDF/UA
ISO 14289: Universal Accessibility
© 2014, iText Group NV, iText Software Corp., iText Software BVBA
Every one can read this
PDF is dead; Long live PDF... and Java!23
© 2014, iText Group NV, iText Software Corp., iText Software BVBA
But some structure is helpful
PDF is dead; Long live PDF... and Java!24
title
list item
list item
list item
Label Content
© 2014, iText Group NV, iText Software Corp., iText Software BVBA
Can every one read this?
PDF is dead; Long live PDF... and Java!25
© 2014, iText Group NV, iText Software Corp., iText Software BVBA
How do we read the spider chart?
PDF is dead; Long live PDF... and Java!26
Person 2 1.7 1.4 1.3 1.9 2.1 0.8 2.2 1.8 1.6 1 1.4
Position 3 2.3 2 1.8 3.2 3.9 2.1 3.1 3.2 2.3 2 2.1
RiskManagement
StructuredFinance
Mergers&acquisitions
Governance&InternalControl
AccountingOperations
Treasuryoperations
ManagementInformation&
BusinessDecisionSupport
BusinessPlanning&Strategy
FinanceContributiontoIT
Management
CommercialActivities
Taxation
FunctionalLeadership
© 2014, iText Group NV, iText Software Corp., iText Software BVBA
Is this a better way to read the data?
PDF is dead; Long live PDF... and Java!27
Person Position
Functional Leadership 2 3
Risk Management 1.7 2.3
Structured Finance 1.4 2
Mergers & Acquisitions 1.3 1.8
Governance & Internal Control 1.9 3.2
Accounting Operations 2.1 3.9
Treasury Operations 0.8 2.1
Management Information & Business Decision Support 2.2 3.1
Business Planning & Strategy 1.8 3.2
Finance Contribution to IT Managemen 1.6 2.3
Commencial Activities 1 2
Taxation 1.4 2.1
© 2014, iText Group NV, iText Software Corp., iText Software BVBA
PDF/UA to the rescue
Let’s agree on a standard way to store/interpret documents
ISO 14289: Universal Accessibility
PDF/UA is a technical specification intended for developers implementing PDF writing and
processing software.
PDF/UA provides definitive terms and requirements to allow people with/without
disabilities the same rights.
For those equipped with appropriate software, conformance with PDF/UA ensures
accessibility for people with disabilities who use assistive technology such as screen
readers, screen magnifiers, joysticks and other technologies to navigate and read electronic
content.
PDF is dead; Long live PDF... and Java!28
© 2014, iText Group NV, iText Software Corp., iText Software BVBA© 2014, iText Group NV, iText Software Corp., iText Software BVBA
PAdES
ETSI TS 102 778: PDF Advanced Electronic Signatures
© 2014, iText Group NV, iText Software Corp., iText Software BVBA
Integrity
PDF is dead; Long live PDF... and Java!30
I paid a forged invoice
and lost $40K!
© 2014, iText Group NV, iText Software Corp., iText Software BVBA
Authenticity
PDF is dead; Long live PDF... and Java!31
Why am I, Emperor Constantine I,
in this picture? I never transferred
authority to the Pope!
© 2014, iText Group NV, iText Software Corp., iText Software BVBA
Non-repudiation
PDF is dead; Long live PDF... and Java!32
I didn’t do it!
© 2014, iText Group NV, iText Software Corp., iText Software BVBA
Business requirements for signatures
PDF is dead; Long live PDF... and Java!33
Let’s agree on a standard, vendor-independent way to ensure
document integrity, authentication and non-repudiation
© 2014, iText Group NV, iText Software Corp., iText Software BVBA
PAdES to the rescue!
ISO
ISO-32000-1 (2008) based on PDF 1.7 (2006)
ISO-32000-2 will define PDF 2.0 (2016)
ETSI: TS 102 778 (2009 - 2010)
PAdES 1: Overview
PAdES 2: Basic – CMS based (ISO-32000-1)
PAdES 3: Enhanced – CAdES based (ISO-32000-2)
PAdES 4: LTV – Long Term Validation
PAdES 5: XAdES based (XML content)
PAdES 6: Visual representation guidelines
ETSI: TS 103 172 (2011 - 2013)
PAdES Baseline Profile
PDF is dead; Long live PDF... and Java!34
© 2014, iText Group NV, iText Software Corp., iText Software BVBA© 2014, iText Group NV, iText Software Corp., iText Software BVBA
PDF/A-3 - ZUGFeRD
ISO 19005-3: Archiving
ZUGFeRD: Invoicing
© 2014, iText Group NV, iText Software Corp., iText Software BVBA
Paying invoices is a pain
PDF is dead; Long live PDF... and Java!36
© 2014, iText Group NV, iText Software Corp., iText Software BVBA
Processing invoices is a cost
PDF is dead; Long live PDF... and Java!37
© 2014, iText Group NV, iText Software Corp., iText Software BVBA
We need a standard!
What if a vendor would provide an invoice that:
Can be read by a human being? (Use PDF?)
Can be processed by a machine? (Use XML?)
What would it take to make sure that:
You don’t have to do any manual work to input the amount to be paid, sales tax,…?
(Structured info?)
The invoice can be preserved for the long term? (PDF/A?)
PDF is dead; Long live PDF... and Java!38
© 2014, iText Group NV, iText Software Corp., iText Software BVBA
PDF/A-3 to the rescue!
PDF is dead; Long live PDF... and Java!39
Let’s agree on a standard way to archive documents
ISO 19005 part 3:
PDF/A is an ISO-standardized version of the Portable Document Format (PDF) specialized for
the digital preservation of electronic documents.
PDF/A-3 allows attachments that are not compliant with PDF/A, e.g. an e-mail, machine
readable data such as an XML file,…
© 2014, iText Group NV, iText Software Corp., iText Software BVBA
Invoice + XML Attachment
PDF is dead; Long live PDF... and Java!40
© 2014, iText Group NV, iText Software Corp., iText Software BVBA
ZUGFeRD to the rescue!
PDF is dead; Long live PDF... and Java!41
Let’s agree on a standard way to exchange invoices
ZUGFeRD: a pioneer to fix PDF invoicing
Developed by a Workgroup called “Forum elektronische Rechnung Deutschland” (FeRD).
Based on PDF/A-3: archiving + attachment.
Imposes an XML schema for the data added in attachment.
Data can be extracted and processed without human intervention:
• This speeds up the processing of invoices,
• Makes the process less error-prone, and
• Reduces the cost.
© 2014, iText Group NV, iText Software Corp., iText Software BVBA© 2014, iText Group NV, iText Software Corp., iText Software BVBA
Conclusions
Why are standards important in business?
© 2014, iText Group NV, iText Software Corp., iText Software BVBA
PDF is dead; Long live PDF... and Java!43
Standards ensure:
Clarity, as shown in the PDF/UA use case,
Security, as shown in the PAdES use case,
Interoperability, as shown in the ZUGFeRD use case,
And much more!
© 2014, iText Group NV, iText Software Corp., iText Software BVBA© 2014, iText Group NV, iText Software Corp., iText Software BVBA
Creating PDF/UA, PDF/A-3, ZUGFeRD
© 2014, iText Group NV, iText Software Corp., iText Software BVBA
Step 1. Create PDF
PDF
PDF is dead; Long live PDF... and Java!45
© 2014, iText Group NV, iText Software Corp., iText Software BVBA
Step1. Create PDF: Initialize document
Document document = new Document();
PdfWriter writer =
PdfWriter.getInstance(document,
new FileOutputStream("SimplePdf.pdf"));
writer.setPdfVersion(PdfWriter.VERSION_1_7);
document.open();
PDF is dead; Long live PDF... and Java!46
© 2014, iText Group NV, iText Software Corp., iText Software BVBA
Step1. Create PDF: Add elements
Paragraph p = new Paragraph();
Chunk c = new Chunk("The quick brown ");
p.add(c);
Image i = Image.getInstance("fox.bmp");
c = new Chunk(i, 0, -24);
p.add(c);
c = new Chunk(" jumps over the lazy ");
p.add(c);
i = Image.getInstance("dog.bmp");
c = new Chunk(i, 0, -24);
p.add(c);
document.add(p);
PDF is dead; Long live PDF... and Java!47
© 2014, iText Group NV, iText Software Corp., iText Software BVBA
Step 1. Create PDF: Close document
document.close();
PDF is dead; Long live PDF... and Java!48
© 2014, iText Group NV, iText Software Corp., iText Software BVBA
Step 1. Create PDF: Result
PDF is dead; Long live PDF... and Java!49
© 2014, iText Group NV, iText Software Corp., iText Software BVBA
Step 2. Create Tagged PDF
PDF is dead; Long live PDF... and Java!50
PDF
Tagged
content
Tagged
PDF
© 2014, iText Group NV, iText Software Corp., iText Software BVBA
Step 2. Create Tagged PDF
PdfWriter writer = PdfWriter.getInstance(…);
writer.setPdfVersion(PdfWriter.VERSION_1_7);
writer.setTagged();
document.open();
PDF
Tagged
content
Tagged
PDF
PDF is dead; Long live PDF... and Java!51
© 2014, iText Group NV, iText Software Corp., iText Software BVBA
Step 2. Create Tagged PDF
PDF is dead; Long live PDF... and Java!52
PDF
Tagged
content
Tagged
PDF
© 2014, iText Group NV, iText Software Corp., iText Software BVBA
Step 3. Create PDF/UA
PDF is dead; Long live PDF... and Java!53
Tagged PDF Metadata
Font
embedding
Alt text PDF/UA
© 2014, iText Group NV, iText Software Corp., iText Software BVBA
Step 3. Create PDF/UA
Goals
Provide document title, author, keywords
Provide document language for better accessibility
Identify “type” of PDF (PDF/UA) to help PDF reader
PDF is dead; Long live PDF... and Java!54
Tagged PDF Metadata
Font
embedding
Alt text PDF/UA
© 2014, iText Group NV, iText Software Corp., iText Software BVBA
Step 3. Create PDF/UA
writer.setTagged();
writer.setViewerPreferences
(PdfWriter.DisplayDocTitle);
document.addLanguage("en-US");
document.addTitle("English pangram");
writer.createXmpMetadata();
document.open();
PDF is dead; Long live PDF... and Java!55
Tagged PDF Metadata
Font
embedding
Alt text PDF/UA
© 2014, iText Group NV, iText Software Corp., iText Software BVBA
Step 3. Create PDF/UA
PDF is dead; Long live PDF... and Java!56
Tagged PDF Metadata
Font
embedding
Alt text PDF/UA
© 2014, iText Group NV, iText Software Corp., iText Software BVBA
Step 3. Create PDF/UA
Goals
Make document independent of font set of current OS
Make document independent of font selection strategy of PDF reader
Make document fully portable
PDF is dead; Long live PDF... and Java!57
Tagged PDF Metadata
Font
embedding
Alt text PDF/UA
© 2014, iText Group NV, iText Software Corp., iText Software BVBA
Step 3. Create PDF/UA
document.open();
Paragraph p = new Paragraph();
p.setFont(FontFactory.getFont("FreeSans.ttf",
BaseFont.WINANSI, BaseFont.EMBEDDED, 20));
Chunk c = new Chunk("The quick brown ");
p.add(c);
PDF is dead; Long live PDF... and Java!58
Tagged PDF Metadata
Font
embedding
Alt text PDF/UA
© 2014, iText Group NV, iText Software Corp., iText Software BVBA
Step 3. Create PDF/UA
PDF is dead; Long live PDF... and Java!59
Tagged PDF Metadata
Font
embedding
Alt text PDF/UA
Before After
© 2014, iText Group NV, iText Software Corp., iText Software BVBA
Step 3. Create PDF/UA
PDF is dead; Long live PDF... and Java!60
Tagged PDF Metadata
Font
embedding
Alt text PDF/UA
© 2014, iText Group NV, iText Software Corp., iText Software BVBA
Step 3. Create PDF/UA
Goals
Provide alternate text for non-textual content
Help conforming readers to read out loud the non-textual content
PDF is dead; Long live PDF... and Java!61
Tagged PDF Metadata
Font
embedding
Alt text PDF/UA
© 2014, iText Group NV, iText Software Corp., iText Software BVBA
Step 3. Create PDF/UA
Image i = Image.getInstance("fox.bmp");
c = new Chunk(i, 0, -24);
c.setAccessibleAttribute(PdfName.ALT,
new PdfString("Fox"));
p.add(c);
PDF is dead; Long live PDF... and Java!62
Tagged PDF Metadata
Font
embedding
Alt text PDF/UA
© 2014, iText Group NV, iText Software Corp., iText Software BVBA
Step 3. Create PDF/UA
PDF is dead; Long live PDF... and Java!63
Tagged PDF Metadata
Font
embedding
Alt text PDF/UA
© 2014, iText Group NV, iText Software Corp., iText Software BVBA
Step 3. Create PDF/UA
PDF is dead; Long live PDF... and Java!64
Tagged PDF Metadata
Font
embedding
Alt text PDF/UA
© 2014, iText Group NV, iText Software Corp., iText Software BVBA
Step 4. Create PDF/A-3b
PDF is dead; Long live PDF... and Java!65
PDF Metadata
Font
embedding
Output
intents
PDF/A-3b
© 2014, iText Group NV, iText Software Corp., iText Software BVBA
Step 4. Create PDF/A-3b
Document document = new Document();
PdfAWriter writer = PdfAWriter.getInstance(document,
new FileOutputStream("PdfA3b.pdf"),
PdfAConformanceLevel.PDF_A_3B);
writer.setPdfVersion(PdfWriter.VERSION_1_7);
PDF is dead; Long live PDF... and Java!66
PDF Metadata
Font
embedding
Output
intents
PDF/A-3b
© 2014, iText Group NV, iText Software Corp., iText Software BVBA
Step 4. Create PDF/A-3b
Goals
Identify “type” of PDF (PDF/A) to help PDF reader
Similar iText code as for PDF/UA
PDF is dead; Long live PDF... and Java!67
PDF Metadata
Font
embedding
Output
intents
PDF/A-3b
© 2014, iText Group NV, iText Software Corp., iText Software BVBA
Step 4. Create PDF/A-3b
PDF is dead; Long live PDF... and Java!68
PDF Metadata
Font
embedding
Output
intents
PDF/A-3b
© 2014, iText Group NV, iText Software Corp., iText Software BVBA
Step 4. Create PDF/A-3b
Goals
Make document fully self contained and archivable
Same iText code as for PDF/UA
PDF is dead; Long live PDF... and Java!69
PDF Metadata
Font
embedding
Output
intents
PDF/A-3b
© 2014, iText Group NV, iText Software Corp., iText Software BVBA
Step 4. Create PDF/A-3b
Goals
Match color characteristics of PDF document with color characteristics of
device on which it is intended to be rendered
Make colors device independent
PDF is dead; Long live PDF... and Java!70
PDF Metadata
Font
embedding
Output
intents
PDF/A-3b
© 2014, iText Group NV, iText Software Corp., iText Software BVBA
Step 4. Create PDF/A-3b
document.open();
ICC_Profile icc = ICC_Profile.getInstance(new
FileInputStream("sRGB Color Space
Profile.icm"));
writer.setOutputIntents("Custom", "",
"http://www.color.org", "sRGB IEC61966-2.1",
icc);
Paragraph p = new Paragraph();
PDF is dead; Long live PDF... and Java!71
PDF Metadata
Font
embedding
Output
intents
PDF/A-3b
© 2014, iText Group NV, iText Software Corp., iText Software BVBA
Step 4. Create PDF/A-3b
PDF is dead; Long live PDF... and Java!72
PDF Metadata
Font
embedding
Output
intents
PDF/A-3b
© 2014, iText Group NV, iText Software Corp., iText Software BVBA
Step 4. Create PDF/A-3b
PDF is dead; Long live PDF... and Java!73
PDF Metadata
Font
embedding
Output
intents
PDF/A-3b
© 2014, iText Group NV, iText Software Corp., iText Software BVBA
Step 5. Create PDF/A-3a
PDF is dead; Long live PDF... and Java!74
PDF/A-
3b
PDF/UA
PDF/A-
3a
© 2014, iText Group NV, iText Software Corp., iText Software BVBA
Step 5. Create PDF/A-3a
Document document = new Document();
PdfAWriter writer = PdfAWriter.getInstance(document,
new FileOutputStream("PdfA3a.pdf"),
PdfAConformanceLevel.PDF_A_3A);
writer.setPdfVersion(PdfWriter.VERSION_1_7);
PDF is dead; Long live PDF... and Java!75
PDF/A-
3b
PDF/UA
PDF/A-
3a
© 2014, iText Group NV, iText Software Corp., iText Software BVBA
Step 5. Create PDF/A-3a
PDF is dead; Long live PDF... and Java!76
PDF/A-
3b
PDF/UA
PDF/A-
3a
© 2014, iText Group NV, iText Software Corp., iText Software BVBA
Step 5. Create PDF/A-3a
Can I make sure that my document is compliant?
iText will:
Perform a lot of checks, from technical PoV, based on the requested
conformance level
Throw an exception if a requirement is not met
Not everything can be checked automatically!
PDF is dead; Long live PDF... and Java!77
PDF/A-
3b
PDF/UA
PDF/A-
3a
© 2014, iText Group NV, iText Software Corp., iText Software BVBA
Step 5. Create PDF/A-3a
PDF is dead; Long live PDF... and Java!78
PDF/A-
3b
PDF/UA
PDF/A-
3a
© 2014, iText Group NV, iText Software Corp., iText Software BVBA
Create ZUGFeRD invoices
PDF is dead; Long live PDF... and Java!79
PDF/A-3b
XMP
metadata
Invoice
attachment
ZUGFeRD
PDF
© 2014, iText Group NV, iText Software Corp., iText Software BVBA
Create ZUGFeRD invoices
Document document = new Document();
PdfAWriter writer = PdfAWriter.getInstance(document,
new FileOutputStream("Zugferd.pdf"),
PdfAConformanceLevel.ZUGFeRD);
writer.setPdfVersion(PdfWriter.VERSION_1_7);
PDF is dead; Long live PDF... and Java!80
PDF/A-3b
XMP
metadata
Invoice
attachment
ZUGFeRD
PDF
© 2014, iText Group NV, iText Software Corp., iText Software BVBA
Create ZUGFeRD invoices
writer.createXmpMetadata();
writer.getXmpWriter().setProperty(
PdfAXmpWriter.zugferdSchemaNS,
PdfAXmpWriter.zugferdDocumentFileName,
"invoice.xml");
document.open();
PDF is dead; Long live PDF... and Java!81
PDF/A-3b
XMP
metadata
Invoice
attachment
ZUGFeRD
PDF
© 2014, iText Group NV, iText Software Corp., iText Software BVBA
Create ZUGFeRD invoices
PdfFileSpecification fileSpec =
writer.addFileAttachment("ZUGFeRD invoice",
null, "c:/invoice.xml", "invoice.xml",
"application/xml",
new AFRelationshipValue.Alternative);
PDF is dead; Long live PDF... and Java!82
PDF/A-3b
XMP
metadata
Invoice
attachment
ZUGFeRD
PDF
© 2014, iText Group NV, iText Software Corp., iText Software BVBA
Create ZUGFeRD invoices
PDF is dead; Long live PDF... and Java!83
PDF/A-3b
XMP
metadata
Invoice
attachment
ZUGFeRD
PDF
© 2014, iText Group NV, iText Software Corp., iText Software BVBA© 2014, iText Group NV, iText Software Corp., iText Software BVBA
The DNA of PDF
The Structure of a PDF file
Looking at a PDF from a text editor
Browsing Java objects using Java Swing
© 2014, iText Group NV, iText Software Corp., iText Software BVBA
The structure of a PDF file
PDF is dead; Long live PDF... and Java!85
Header
Body
Cross-Reference Table
Trailer
© 2014, iText Group NV, iText Software Corp., iText Software BVBA
Demo-time
PDF is dead; Long live PDF... and Java!86
© 2014, iText Group NV, iText Software Corp., iText Software BVBA© 2014, iText Group NV, iText Software Corp., iText Software BVBA
Finding Structure in PDF
© 2014, iText Group NV, iText Software Corp., iText Software BVBA
Listener for text snippets
public class MyTextRenderListener implements RenderListener {
public void beginTextBlock() {
System.out.println("<");
}
public void endTextBlock() {
System.out.println(">");
}
public void renderImage(ImageRenderInfo renderInfo) {
}
public void renderText(TextRenderInfo renderInfo) {
System.out.println(" <");
Vector start = renderInfo.getBaseline().getStartPoint();
System.out.println(String.format(" x: %s y: %s length: %s n Text: %s",
start.get(Vector.I1), start.get(Vector.I2),
renderInfo.getBaseline().getLength(), renderInfo.getText()));
out.println(" >");
}
}
PDF is dead; Long live PDF... and Java!88
© 2014, iText Group NV, iText Software Corp., iText Software BVBA
Parsing PDF
PdfReader reader = new PdfReader(src);
RenderListener listener = new MyTextRenderListener();
PdfContentStreamProcessor processor = new PdfContentStreamProcessor(listener);
PdfDictionary pageDic = reader.getPageN(1);
PdfDictionary resourcesDic =
pageDic.getAsDict(PdfName.RESOURCES);
processor.processContent(
ContentByteUtils.getContentBytesForPage(reader, 1), resourcesDic);
reader.close();
PDF is dead; Long live PDF... and Java!89
© 2014, iText Group NV, iText Software Corp., iText Software BVBA
Example page to parse
PDF is dead; Long live PDF... and Java!90
© 2014, iText Group NV, iText Software Corp., iText Software BVBA
Providing hints
PDF is dead; Long live PDF... and Java!91
© 2014, iText Group NV, iText Software Corp., iText Software BVBA
Providing hints
PDF is dead; Long live PDF... and Java!92
© 2014, iText Group NV, iText Software Corp., iText Software BVBA
Providing hints
PDF is dead; Long live PDF... and Java!93
© 2014, iText Group NV, iText Software Corp., iText Software BVBA
Demo
Finding text snippets
Finding text lines
Finding text structure
PDF is dead; Long live PDF... and Java!94
© 2014, iText Group NV, iText Software Corp., iText Software BVBA© 2014, iText Group NV, iText Software Corp., iText Software BVBA
Wrapping up
The Technical Roadmap for iText
Further reading
Q&A
© 2014, iText Group NV, iText Software Corp., iText Software BVBA
Roadmap 2012
Mobile versus Cloud
Android version
Google App Engine (GAE) Version
Digital Signatures
Update to new specs
Documentation
XML Worker / XFA Worker
Generic XML to PDF engine
Test with HTML, target XFA
PDF is dead; Long live PDF... and Java!96
© 2014, iText Group NV, iText Software Corp., iText Software BVBA
Roadmap 2013
Creating Tagged PDF
From high-level objects
From XFA Worker
Focus on standards
Rewriting the PDF/A functionality
Introducing PDF/UA support
PAdES 5
XML-DSig + XAdES
PDF is dead; Long live PDF... and Java!97
© 2014, iText Group NV, iText Software Corp., iText Software BVBA
Roadmap 2014
Major upgrade for RUPS
Reading and Updating PDF Syntax
XFA Worker: Enterprise-grade solution
Support for JavaScript
Standards
Complete PDF/UA
Complete PDF/A-2, PDF/A-3, ZUGFeRD
PDF is dead; Long live PDF... and Java!98
© 2014, iText Group NV, iText Software Corp., iText Software BVBA
Roadmap 2015
Customer-driven development
E.g. “Redaction”
Unstructured PDFs
Turn our research into development
PDF 2.0
Making iText ready for PDF 2.0
Next ISO Committee meeting: November 2014, Edinburgh
PDF is dead; Long live PDF... and Java!99
© 2014, iText Group NV, iText Software Corp., iText Software BVBA
Books published by Manning
PDF is dead; Long live PDF... and Java!100
1st Edition: 2006
• 11.500 copies
2nd Edition: 2010
• 8.000 copies
© 2014, iText Group NV, iText Software Corp., iText Software BVBA
New book in the making
PDF is dead; Long live PDF... and Java!101
© 2014, iText Group NV, iText Software Corp., iText Software BVBA
Upcoming titles
PDF is dead; Long live PDF... and Java!102
© 2014, iText Group NV, iText Software Corp., iText Software BVBA
PDF is dead; Long live PDF... and Java!103
Thank you!
Questions and answers
Visit us at booth #5712

More Related Content

What's hot

The effects of the GDPR
The effects of the GDPRThe effects of the GDPR
The effects of the GDPRiText Group nv
 
Tech Startup Day 2015: 4 failures and 1 hit
Tech Startup Day 2015: 4 failures and 1 hitTech Startup Day 2015: 4 failures and 1 hit
Tech Startup Day 2015: 4 failures and 1 hitiText Group nv
 
Intellectual property and licensing
Intellectual property and licensingIntellectual property and licensing
Intellectual property and licensingiText 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
 
Monetizing open-source projects
Monetizing open-source projectsMonetizing open-source projects
Monetizing open-source projectsiText 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
 
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
 
FIT Seminar Singapore presentation
FIT Seminar Singapore presentationFIT Seminar Singapore presentation
FIT Seminar Singapore presentationiText Group nv
 
Open source: an introduction to IP and Legal
Open source: an introduction to IP and LegalOpen source: an introduction to IP and Legal
Open source: an introduction to IP and LegalBruno Lowagie
 
20200903 The 2020 buildingSMART Data Dictionary prototype (bSDD)
20200903 The 2020 buildingSMART Data Dictionary prototype (bSDD)20200903 The 2020 buildingSMART Data Dictionary prototype (bSDD)
20200903 The 2020 buildingSMART Data Dictionary prototype (bSDD)Léon Berlo
 
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
 
Challenges of applying Blockchain to enterprise systems in NTTDATA
Challenges of applying Blockchain to enterprise systems in NTTDATAChallenges of applying Blockchain to enterprise systems in NTTDATA
Challenges of applying Blockchain to enterprise systems in NTTDATAHyperleger Tokyo Meetup
 
Open Brighton - Open Source and your business
Open Brighton - Open Source and your businessOpen Brighton - Open Source and your business
Open Brighton - Open Source and your businessOmnis Systems
 
WebRTC: The Big Debate, Shut Up and Build Something
WebRTC: The Big Debate, Shut Up and Build SomethingWebRTC: The Big Debate, Shut Up and Build Something
WebRTC: The Big Debate, Shut Up and Build SomethingDigium
 
Astricon 2014 - WebRTC - The Big Debate, I Say Shut Up and Build Something - ...
Astricon 2014 - WebRTC - The Big Debate, I Say Shut Up and Build Something - ...Astricon 2014 - WebRTC - The Big Debate, I Say Shut Up and Build Something - ...
Astricon 2014 - WebRTC - The Big Debate, I Say Shut Up and Build Something - ...Blacc Spot Media, Inc.
 

What's hot (17)

The effects of the GDPR
The effects of the GDPRThe effects of the GDPR
The effects of the GDPR
 
Tech Startup Day 2015: 4 failures and 1 hit
Tech Startup Day 2015: 4 failures and 1 hitTech Startup Day 2015: 4 failures and 1 hit
Tech Startup Day 2015: 4 failures and 1 hit
 
Intellectual property and licensing
Intellectual property and licensingIntellectual property and licensing
Intellectual property and licensing
 
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
 
Monetizing open-source projects
Monetizing open-source projectsMonetizing open-source projects
Monetizing open-source projects
 
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
 
Oops, I broke my API
Oops, I broke my APIOops, I broke my API
Oops, I broke my API
 
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
 
FIT Seminar Singapore presentation
FIT Seminar Singapore presentationFIT Seminar Singapore presentation
FIT Seminar Singapore presentation
 
Open source: an introduction to IP and Legal
Open source: an introduction to IP and LegalOpen source: an introduction to IP and Legal
Open source: an introduction to IP and Legal
 
sdch
sdchsdch
sdch
 
20200903 The 2020 buildingSMART Data Dictionary prototype (bSDD)
20200903 The 2020 buildingSMART Data Dictionary prototype (bSDD)20200903 The 2020 buildingSMART Data Dictionary prototype (bSDD)
20200903 The 2020 buildingSMART Data Dictionary prototype (bSDD)
 
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
 
Challenges of applying Blockchain to enterprise systems in NTTDATA
Challenges of applying Blockchain to enterprise systems in NTTDATAChallenges of applying Blockchain to enterprise systems in NTTDATA
Challenges of applying Blockchain to enterprise systems in NTTDATA
 
Open Brighton - Open Source and your business
Open Brighton - Open Source and your businessOpen Brighton - Open Source and your business
Open Brighton - Open Source and your business
 
WebRTC: The Big Debate, Shut Up and Build Something
WebRTC: The Big Debate, Shut Up and Build SomethingWebRTC: The Big Debate, Shut Up and Build Something
WebRTC: The Big Debate, Shut Up and Build Something
 
Astricon 2014 - WebRTC - The Big Debate, I Say Shut Up and Build Something - ...
Astricon 2014 - WebRTC - The Big Debate, I Say Shut Up and Build Something - ...Astricon 2014 - WebRTC - The Big Debate, I Say Shut Up and Build Something - ...
Astricon 2014 - WebRTC - The Big Debate, I Say Shut Up and Build Something - ...
 

Similar to PDF is dead. Long live PDF... with Java!

IRJET - V-IDE: Voice Controlled IDE using Natural Language Processing and...
IRJET -  	  V-IDE: Voice Controlled IDE using Natural Language Processing and...IRJET -  	  V-IDE: Voice Controlled IDE using Natural Language Processing and...
IRJET - V-IDE: Voice Controlled IDE using Natural Language Processing and...IRJET Journal
 
IRJET- Smart Way of File Conversion using Python
IRJET- Smart Way of File Conversion using PythonIRJET- Smart Way of File Conversion using Python
IRJET- Smart Way of File Conversion using PythonIRJET Journal
 
IRJET- Online Compiler for Computer Languages with Security Editor
IRJET-  	  Online Compiler for Computer Languages with Security EditorIRJET-  	  Online Compiler for Computer Languages with Security Editor
IRJET- Online Compiler for Computer Languages with Security EditorIRJET Journal
 
VeryPDF .NET PDF Editor SDK for Developers Royalty Free _ VeryPDF Knowledge B...
VeryPDF .NET PDF Editor SDK for Developers Royalty Free _ VeryPDF Knowledge B...VeryPDF .NET PDF Editor SDK for Developers Royalty Free _ VeryPDF Knowledge B...
VeryPDF .NET PDF Editor SDK for Developers Royalty Free _ VeryPDF Knowledge B...Lingwen1998
 
OGDC 2014: Cross Platform Mobile Game Application Development
OGDC 2014: Cross Platform Mobile Game Application DevelopmentOGDC 2014: Cross Platform Mobile Game Application Development
OGDC 2014: Cross Platform Mobile Game Application DevelopmentGameLandVN
 
OGDC 2014_Cross platform mobile game application development_Mr. Makku J.Kero
OGDC 2014_Cross platform mobile game application development_Mr. Makku J.KeroOGDC 2014_Cross platform mobile game application development_Mr. Makku J.Kero
OGDC 2014_Cross platform mobile game application development_Mr. Makku J.Keroogdc
 
Bridging the gap between business and technology - Behaviour Driven Developme...
Bridging the gap between business and technology - Behaviour Driven Developme...Bridging the gap between business and technology - Behaviour Driven Developme...
Bridging the gap between business and technology - Behaviour Driven Developme...Eugenio Minardi
 
LOC presentation 2020: Future of openBIM standards
LOC presentation 2020: Future of openBIM standardsLOC presentation 2020: Future of openBIM standards
LOC presentation 2020: Future of openBIM standardsLéon Berlo
 
Text to docx and Pdf conversion
Text to docx and Pdf conversionText to docx and Pdf conversion
Text to docx and Pdf conversionHozaifa Moaj
 
VeryUtils Java PDF Command Line SDK API for Developers Royalty Free.pdf
VeryUtils Java PDF Command Line SDK API for Developers Royalty Free.pdfVeryUtils Java PDF Command Line SDK API for Developers Royalty Free.pdf
VeryUtils Java PDF Command Line SDK API for Developers Royalty Free.pdfLingwen1998
 
AWE USA 2019: 2 Partners sharing 1 vision for smart operators
AWE USA 2019: 2 Partners sharing 1 vision for smart operatorsAWE USA 2019: 2 Partners sharing 1 vision for smart operators
AWE USA 2019: 2 Partners sharing 1 vision for smart operatorsAugmentedWorldExpo
 
VeryUtils PDF Command Line Tools and API for Java.docx
VeryUtils PDF Command Line Tools and API for Java.docxVeryUtils PDF Command Line Tools and API for Java.docx
VeryUtils PDF Command Line Tools and API for Java.docxLingwen1998
 
LANGUAGE TRANSLATOR APP
LANGUAGE TRANSLATOR APPLANGUAGE TRANSLATOR APP
LANGUAGE TRANSLATOR APPIRJET Journal
 
The Best Python IDEs and Code Editors.pdf
The Best Python IDEs and Code Editors.pdfThe Best Python IDEs and Code Editors.pdf
The Best Python IDEs and Code Editors.pdfAppdeveloper10
 
VeryUtils PDF to HTML5 Form Filler for PHP does View.docx
VeryUtils PDF to HTML5 Form Filler for PHP does View.docxVeryUtils PDF to HTML5 Form Filler for PHP does View.docx
VeryUtils PDF to HTML5 Form Filler for PHP does View.docxLingwen1998
 
Presentation by Joe Bachana of DPCI at Lavacon 2012
Presentation by Joe Bachana of DPCI at Lavacon 2012Presentation by Joe Bachana of DPCI at Lavacon 2012
Presentation by Joe Bachana of DPCI at Lavacon 2012Joe Bachana
 
Microsoft Skype for Business and the quest for legacy video interoperability
Microsoft Skype for Business and the quest for legacy video interoperabilityMicrosoft Skype for Business and the quest for legacy video interoperability
Microsoft Skype for Business and the quest for legacy video interoperabilityAnders Løkke
 

Similar to PDF is dead. Long live PDF... with Java! (20)

IRJET - V-IDE: Voice Controlled IDE using Natural Language Processing and...
IRJET -  	  V-IDE: Voice Controlled IDE using Natural Language Processing and...IRJET -  	  V-IDE: Voice Controlled IDE using Natural Language Processing and...
IRJET - V-IDE: Voice Controlled IDE using Natural Language Processing and...
 
IRJET- Smart Way of File Conversion using Python
IRJET- Smart Way of File Conversion using PythonIRJET- Smart Way of File Conversion using Python
IRJET- Smart Way of File Conversion using Python
 
IRJET- Online Compiler for Computer Languages with Security Editor
IRJET-  	  Online Compiler for Computer Languages with Security EditorIRJET-  	  Online Compiler for Computer Languages with Security Editor
IRJET- Online Compiler for Computer Languages with Security Editor
 
Document Processing Made Better - Hadi Harb, Apryse
Document Processing Made Better - Hadi Harb, ApryseDocument Processing Made Better - Hadi Harb, Apryse
Document Processing Made Better - Hadi Harb, Apryse
 
VeryPDF .NET PDF Editor SDK for Developers Royalty Free _ VeryPDF Knowledge B...
VeryPDF .NET PDF Editor SDK for Developers Royalty Free _ VeryPDF Knowledge B...VeryPDF .NET PDF Editor SDK for Developers Royalty Free _ VeryPDF Knowledge B...
VeryPDF .NET PDF Editor SDK for Developers Royalty Free _ VeryPDF Knowledge B...
 
OGDC 2014: Cross Platform Mobile Game Application Development
OGDC 2014: Cross Platform Mobile Game Application DevelopmentOGDC 2014: Cross Platform Mobile Game Application Development
OGDC 2014: Cross Platform Mobile Game Application Development
 
OGDC 2014_Cross platform mobile game application development_Mr. Makku J.Kero
OGDC 2014_Cross platform mobile game application development_Mr. Makku J.KeroOGDC 2014_Cross platform mobile game application development_Mr. Makku J.Kero
OGDC 2014_Cross platform mobile game application development_Mr. Makku J.Kero
 
Node.js as an IOT Bridge
Node.js as an IOT BridgeNode.js as an IOT Bridge
Node.js as an IOT Bridge
 
Bridging the gap between business and technology - Behaviour Driven Developme...
Bridging the gap between business and technology - Behaviour Driven Developme...Bridging the gap between business and technology - Behaviour Driven Developme...
Bridging the gap between business and technology - Behaviour Driven Developme...
 
LOC presentation 2020: Future of openBIM standards
LOC presentation 2020: Future of openBIM standardsLOC presentation 2020: Future of openBIM standards
LOC presentation 2020: Future of openBIM standards
 
Text to docx and Pdf conversion
Text to docx and Pdf conversionText to docx and Pdf conversion
Text to docx and Pdf conversion
 
VeryUtils Java PDF Command Line SDK API for Developers Royalty Free.pdf
VeryUtils Java PDF Command Line SDK API for Developers Royalty Free.pdfVeryUtils Java PDF Command Line SDK API for Developers Royalty Free.pdf
VeryUtils Java PDF Command Line SDK API for Developers Royalty Free.pdf
 
AWE USA 2019: 2 Partners sharing 1 vision for smart operators
AWE USA 2019: 2 Partners sharing 1 vision for smart operatorsAWE USA 2019: 2 Partners sharing 1 vision for smart operators
AWE USA 2019: 2 Partners sharing 1 vision for smart operators
 
VeryUtils PDF Command Line Tools and API for Java.docx
VeryUtils PDF Command Line Tools and API for Java.docxVeryUtils PDF Command Line Tools and API for Java.docx
VeryUtils PDF Command Line Tools and API for Java.docx
 
LANGUAGE TRANSLATOR APP
LANGUAGE TRANSLATOR APPLANGUAGE TRANSLATOR APP
LANGUAGE TRANSLATOR APP
 
The Best Python IDEs and Code Editors.pdf
The Best Python IDEs and Code Editors.pdfThe Best Python IDEs and Code Editors.pdf
The Best Python IDEs and Code Editors.pdf
 
VeryUtils PDF to HTML5 Form Filler for PHP does View.docx
VeryUtils PDF to HTML5 Form Filler for PHP does View.docxVeryUtils PDF to HTML5 Form Filler for PHP does View.docx
VeryUtils PDF to HTML5 Form Filler for PHP does View.docx
 
Presentation by Joe Bachana of DPCI at Lavacon 2012
Presentation by Joe Bachana of DPCI at Lavacon 2012Presentation by Joe Bachana of DPCI at Lavacon 2012
Presentation by Joe Bachana of DPCI at Lavacon 2012
 
IETM Level 4 Service Provider -Code and Pixels.pdf
IETM Level 4 Service Provider -Code and Pixels.pdfIETM Level 4 Service Provider -Code and Pixels.pdf
IETM Level 4 Service Provider -Code and Pixels.pdf
 
Microsoft Skype for Business and the quest for legacy video interoperability
Microsoft Skype for Business and the quest for legacy video interoperabilityMicrosoft Skype for Business and the quest for legacy video interoperability
Microsoft Skype for Business and the quest for legacy video interoperability
 

More from iText Group nv

Build your own_photobooth
Build your own_photoboothBuild your own_photobooth
Build your own_photoboothiText 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
 
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
 
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: 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
 
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 (9)

Build your own_photobooth
Build your own_photoboothBuild your own_photobooth
Build your own_photobooth
 
PDF made easy with iText 7
PDF made easy with iText 7PDF made easy with iText 7
PDF made easy with iText 7
 
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
 
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: 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!
 
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

Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024StefanoLambiase
 
Cyber security and its impact on E commerce
Cyber security and its impact on E commerceCyber security and its impact on E commerce
Cyber security and its impact on E commercemanigoyal112
 
PREDICTING RIVER WATER QUALITY ppt presentation
PREDICTING  RIVER  WATER QUALITY  ppt presentationPREDICTING  RIVER  WATER QUALITY  ppt presentation
PREDICTING RIVER WATER QUALITY ppt presentationvaddepallysandeep122
 
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
 
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdfExploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdfkalichargn70th171
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based projectAnoyGreter
 
cpct NetworkING BASICS AND NETWORK TOOL.ppt
cpct NetworkING BASICS AND NETWORK TOOL.pptcpct NetworkING BASICS AND NETWORK TOOL.ppt
cpct NetworkING BASICS AND NETWORK TOOL.pptrcbcrtm
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaHanief Utama
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfAlina Yurenko
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...OnePlan Solutions
 
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
 
Software Coding for software engineering
Software Coding for software engineeringSoftware Coding for software engineering
Software Coding for software engineeringssuserb3a23b
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtimeandrehoraa
 
VK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web DevelopmentVK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web Developmentvyaparkranti
 
Sending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdfSending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdf31events.com
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样umasea
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationBradBedford3
 

Recently uploaded (20)

Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
 
Cyber security and its impact on E commerce
Cyber security and its impact on E commerceCyber security and its impact on E commerce
Cyber security and its impact on E commerce
 
Advantages of Odoo ERP 17 for Your Business
Advantages of Odoo ERP 17 for Your BusinessAdvantages of Odoo ERP 17 for Your Business
Advantages of Odoo ERP 17 for Your Business
 
PREDICTING RIVER WATER QUALITY ppt presentation
PREDICTING  RIVER  WATER QUALITY  ppt presentationPREDICTING  RIVER  WATER QUALITY  ppt presentation
PREDICTING RIVER WATER QUALITY ppt presentation
 
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
 
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdfExploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based project
 
cpct NetworkING BASICS AND NETWORK TOOL.ppt
cpct NetworkING BASICS AND NETWORK TOOL.pptcpct NetworkING BASICS AND NETWORK TOOL.ppt
cpct NetworkING BASICS AND NETWORK TOOL.ppt
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief Utama
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
 
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
 
2.pdf Ejercicios de programación competitiva
2.pdf Ejercicios de programación competitiva2.pdf Ejercicios de programación competitiva
2.pdf Ejercicios de programación competitiva
 
Software Coding for software engineering
Software Coding for software engineeringSoftware Coding for software engineering
Software Coding for software engineering
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtime
 
VK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web DevelopmentVK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web Development
 
Sending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdfSending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdf
 
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort ServiceHot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion Application
 

PDF is dead. Long live PDF... with Java!

  • 1. © 2014, iText Group NV, iText Software Corp., iText Software BVBA© 2014, iText Group NV, iText Software Corp., iText Software BVBA PDF is dead! Long live PDF! Java One Tutorial 29/09/2014
  • 2. © 2014, iText Group NV, iText Software Corp., iText Software BVBA Is PDF dead? PDF is dead; Long live PDF... and Java!2
  • 3. © 2014, iText Group NV, iText Software Corp., iText Software BVBA PDF is dead; Long live PDF... and Java!3 The PDF Reference Manual
  • 4. © 2014, iText Group NV, iText Software Corp., iText Software BVBA Everybody uses HTML PDF is dead; Long live PDF... and Java!4 Source: http://duff-johnson.com/2014/03/10/ 98-percent-of-dot-com-is-html-but-38-percent-of-dot-gov-is-pdf/
  • 5. © 2014, iText Group NV, iText Software Corp., iText Software BVBA But governments also like PDF PDF is dead; Long live PDF... and Java!5 Source: http://duff-johnson.com/2014/03/10/ 98-percent-of-dot-com-is-html-but-38-percent-of-dot-gov-is-pdf/ Percentage of PDF files: .org: 15% .gov: 38% .edu: 27%
  • 6. © 2014, iText Group NV, iText Software Corp., iText Software BVBA Publications versus… No need to be self-contained and may change over time Not all content produced by the author e.g. Advertisements Becoming more interactive e.g Comments on a news article PDF is dead; Long live PDF... and Java!6 Source: The Future of PDF Leonard Rosenthol, PDF Architect at Adobe
  • 7. © 2014, iText Group NV, iText Software Corp., iText Software BVBA … documents PDF is dead; Long live PDF... and Java!7 Source: The Future of PDF Leonard Rosenthol, PDF Architect at Adobe Needs to be self-contained Unchanging (non-dynamic) Able to be authenticated Able to be secured/protected
  • 8. © 2014, iText Group NV, iText Software Corp., iText Software BVBA Not counting HTML, PDF is King PDF is dead; Long live PDF... and Java!8 Source: http://duff-johnson.com/2014/02/17/ the-8-most-popular-document-formats-on-the-web/
  • 9. © 2014, iText Group NV, iText Software Corp., iText Software BVBA Challenges for PDF Challengers Offline consumption PDF Viewers are ubiquitous (Adobe Reader is on 90% of the desk tops) Mobile consumption Interactivity (forms, commenting,…) Reading books on eReaders Attacking the weaknesses of PDF PDF suffers from “too much” functionality PDF was designed in a “pre-hacker” world Not all tools are created equal • Producers don’t use best practices (e.g. Tagged PDF) • Not all viewers support all features (e.g. EcmaScript) PDF is dead; Long live PDF... and Java!9
  • 10. © 2014, iText Group NV, iText Software Corp., iText Software BVBA Umbrella of Standards PDF is dead; Long live PDF... and Java!10 PDF Portable Document Format First released in 1993 ISO Standard since 2008 ISO 32000 PDF/E engineering Since 2008 ISO 24517 PDF/VT printing Since 2010 ISO 16612 PDF/X graphic arts Since 2001 ISO 15930 PDF/A archive Since 2005 ISO 19005 PDF/UA accessibility Since 2012 ISO 14289 Related: • XFDF (ISO) • EcmaScript (ISO) • PRC (ISO) • PAdES (ETSI)
  • 11. © 2014, iText Group NV, iText Software Corp., iText Software BVBA© 2014, iText Group NV, iText Software Corp., iText Software BVBA Hello iText PDF is dead; Long live PDF... and Java!11
  • 12. © 2014, iText Group NV, iText Software Corp., iText Software BVBA Creating a PDF in 5 steps Example 1: Hello World with iText public void createPdf(String dest) throws DocumentException, IOException { // step 1 Document document = new Document(); // step 2 PdfWriter.getInstance(document, new FileOutputStream(dest)); // step 3 document.open(); // step 4 document.add(new Paragraph("Hello World!")); // step 5 document.close(); } PDF is dead; Long live PDF... and Java!12
  • 13. © 2014, iText Group NV, iText Software Corp., iText Software BVBA A “Hello World” PDF PDF is dead; Long live PDF... and Java!13
  • 14. © 2014, iText Group NV, iText Software Corp., iText Software BVBA A simple form with three fields PDF is dead; Long live PDF... and Java!14 Example : Filling out an existing form
  • 15. © 2014, iText Group NV, iText Software Corp., iText Software BVBA Filling out a form Example 2.a: Filling out a form public void manipulatePdf(String src, String dest) throws DocumentException, IOException { PdfReader reader = new PdfReader(src); PdfStamper stamper = new PdfStamper(reader, new FileOutputStream(dest)); AcroFields form = stamper.getAcroFields(); form.setField("Name", "Raf Hens"); form.setField("Company", "iText Software"); form.setField("Country", "BELGIUM"); stamper.close(); reader.close(); } PDF is dead; Long live PDF... and Java!15
  • 16. © 2014, iText Group NV, iText Software Corp., iText Software BVBA A filled out form PDF is dead; Long live PDF... and Java!16
  • 17. © 2014, iText Group NV, iText Software Corp., iText Software BVBA Flattening out a form Example 2.b: Flattening a form public void manipulatePdf(String src, String dest) throws DocumentException, IOException { PdfReader reader = new PdfReader(src); PdfStamper stamper = new PdfStamper(reader, new FileOutputStream(dest)); AcroFields form = stamper.getAcroFields(); form.setField("Name", "Bruno Lowagie"); form.setField("Company", "iText Group"); form.setField("Country", "BELGIUM"); stamper.setFormFlattening(true); stamper.close(); reader.close(); } PDF is dead; Long live PDF... and Java!17
  • 18. © 2014, iText Group NV, iText Software Corp., iText Software BVBA A flattened form PDF is dead; Long live PDF... and Java!18
  • 19. © 2014, iText Group NV, iText Software Corp., iText Software BVBA Adding a watermark Example 3: Stamping content on a PDF public void manipulatePdf(String src, String dest) throws DocumentException, IOException { PdfReader reader = new PdfReader(src); PdfStamper stamper = new PdfStamper(reader, new FileOutputStream(dest)); PdfContentByte under = stamper.getUnderContent(1); ColumnText.showTextAligned(under, Element.ALIGN_CENTER, new Phrase("Watermark", new Font(FontFamily.HELVETICA, 120)), 297, 421, 45); stamper.close(); reader.close(); } PDF is dead; Long live PDF... and Java!19
  • 20. © 2014, iText Group NV, iText Software Corp., iText Software BVBA© 2014, iText Group NV, iText Software Corp., iText Software BVBA The importance of standards Three use cases
  • 21. © 2014, iText Group NV, iText Software Corp., iText Software BVBA Speaking the same language Not being able to understand each other is a punishment, NOT a business model! Standards are about speaking the same language! PDF is dead; Long live PDF... and Java!21
  • 22. © 2014, iText Group NV, iText Software Corp., iText Software BVBA© 2014, iText Group NV, iText Software Corp., iText Software BVBA PDF/UA ISO 14289: Universal Accessibility
  • 23. © 2014, iText Group NV, iText Software Corp., iText Software BVBA Every one can read this PDF is dead; Long live PDF... and Java!23
  • 24. © 2014, iText Group NV, iText Software Corp., iText Software BVBA But some structure is helpful PDF is dead; Long live PDF... and Java!24 title list item list item list item Label Content
  • 25. © 2014, iText Group NV, iText Software Corp., iText Software BVBA Can every one read this? PDF is dead; Long live PDF... and Java!25
  • 26. © 2014, iText Group NV, iText Software Corp., iText Software BVBA How do we read the spider chart? PDF is dead; Long live PDF... and Java!26 Person 2 1.7 1.4 1.3 1.9 2.1 0.8 2.2 1.8 1.6 1 1.4 Position 3 2.3 2 1.8 3.2 3.9 2.1 3.1 3.2 2.3 2 2.1 RiskManagement StructuredFinance Mergers&acquisitions Governance&InternalControl AccountingOperations Treasuryoperations ManagementInformation& BusinessDecisionSupport BusinessPlanning&Strategy FinanceContributiontoIT Management CommercialActivities Taxation FunctionalLeadership
  • 27. © 2014, iText Group NV, iText Software Corp., iText Software BVBA Is this a better way to read the data? PDF is dead; Long live PDF... and Java!27 Person Position Functional Leadership 2 3 Risk Management 1.7 2.3 Structured Finance 1.4 2 Mergers & Acquisitions 1.3 1.8 Governance & Internal Control 1.9 3.2 Accounting Operations 2.1 3.9 Treasury Operations 0.8 2.1 Management Information & Business Decision Support 2.2 3.1 Business Planning & Strategy 1.8 3.2 Finance Contribution to IT Managemen 1.6 2.3 Commencial Activities 1 2 Taxation 1.4 2.1
  • 28. © 2014, iText Group NV, iText Software Corp., iText Software BVBA PDF/UA to the rescue Let’s agree on a standard way to store/interpret documents ISO 14289: Universal Accessibility PDF/UA is a technical specification intended for developers implementing PDF writing and processing software. PDF/UA provides definitive terms and requirements to allow people with/without disabilities the same rights. For those equipped with appropriate software, conformance with PDF/UA ensures accessibility for people with disabilities who use assistive technology such as screen readers, screen magnifiers, joysticks and other technologies to navigate and read electronic content. PDF is dead; Long live PDF... and Java!28
  • 29. © 2014, iText Group NV, iText Software Corp., iText Software BVBA© 2014, iText Group NV, iText Software Corp., iText Software BVBA PAdES ETSI TS 102 778: PDF Advanced Electronic Signatures
  • 30. © 2014, iText Group NV, iText Software Corp., iText Software BVBA Integrity PDF is dead; Long live PDF... and Java!30 I paid a forged invoice and lost $40K!
  • 31. © 2014, iText Group NV, iText Software Corp., iText Software BVBA Authenticity PDF is dead; Long live PDF... and Java!31 Why am I, Emperor Constantine I, in this picture? I never transferred authority to the Pope!
  • 32. © 2014, iText Group NV, iText Software Corp., iText Software BVBA Non-repudiation PDF is dead; Long live PDF... and Java!32 I didn’t do it!
  • 33. © 2014, iText Group NV, iText Software Corp., iText Software BVBA Business requirements for signatures PDF is dead; Long live PDF... and Java!33 Let’s agree on a standard, vendor-independent way to ensure document integrity, authentication and non-repudiation
  • 34. © 2014, iText Group NV, iText Software Corp., iText Software BVBA PAdES to the rescue! ISO ISO-32000-1 (2008) based on PDF 1.7 (2006) ISO-32000-2 will define PDF 2.0 (2016) ETSI: TS 102 778 (2009 - 2010) PAdES 1: Overview PAdES 2: Basic – CMS based (ISO-32000-1) PAdES 3: Enhanced – CAdES based (ISO-32000-2) PAdES 4: LTV – Long Term Validation PAdES 5: XAdES based (XML content) PAdES 6: Visual representation guidelines ETSI: TS 103 172 (2011 - 2013) PAdES Baseline Profile PDF is dead; Long live PDF... and Java!34
  • 35. © 2014, iText Group NV, iText Software Corp., iText Software BVBA© 2014, iText Group NV, iText Software Corp., iText Software BVBA PDF/A-3 - ZUGFeRD ISO 19005-3: Archiving ZUGFeRD: Invoicing
  • 36. © 2014, iText Group NV, iText Software Corp., iText Software BVBA Paying invoices is a pain PDF is dead; Long live PDF... and Java!36
  • 37. © 2014, iText Group NV, iText Software Corp., iText Software BVBA Processing invoices is a cost PDF is dead; Long live PDF... and Java!37
  • 38. © 2014, iText Group NV, iText Software Corp., iText Software BVBA We need a standard! What if a vendor would provide an invoice that: Can be read by a human being? (Use PDF?) Can be processed by a machine? (Use XML?) What would it take to make sure that: You don’t have to do any manual work to input the amount to be paid, sales tax,…? (Structured info?) The invoice can be preserved for the long term? (PDF/A?) PDF is dead; Long live PDF... and Java!38
  • 39. © 2014, iText Group NV, iText Software Corp., iText Software BVBA PDF/A-3 to the rescue! PDF is dead; Long live PDF... and Java!39 Let’s agree on a standard way to archive documents ISO 19005 part 3: PDF/A is an ISO-standardized version of the Portable Document Format (PDF) specialized for the digital preservation of electronic documents. PDF/A-3 allows attachments that are not compliant with PDF/A, e.g. an e-mail, machine readable data such as an XML file,…
  • 40. © 2014, iText Group NV, iText Software Corp., iText Software BVBA Invoice + XML Attachment PDF is dead; Long live PDF... and Java!40
  • 41. © 2014, iText Group NV, iText Software Corp., iText Software BVBA ZUGFeRD to the rescue! PDF is dead; Long live PDF... and Java!41 Let’s agree on a standard way to exchange invoices ZUGFeRD: a pioneer to fix PDF invoicing Developed by a Workgroup called “Forum elektronische Rechnung Deutschland” (FeRD). Based on PDF/A-3: archiving + attachment. Imposes an XML schema for the data added in attachment. Data can be extracted and processed without human intervention: • This speeds up the processing of invoices, • Makes the process less error-prone, and • Reduces the cost.
  • 42. © 2014, iText Group NV, iText Software Corp., iText Software BVBA© 2014, iText Group NV, iText Software Corp., iText Software BVBA Conclusions Why are standards important in business?
  • 43. © 2014, iText Group NV, iText Software Corp., iText Software BVBA PDF is dead; Long live PDF... and Java!43 Standards ensure: Clarity, as shown in the PDF/UA use case, Security, as shown in the PAdES use case, Interoperability, as shown in the ZUGFeRD use case, And much more!
  • 44. © 2014, iText Group NV, iText Software Corp., iText Software BVBA© 2014, iText Group NV, iText Software Corp., iText Software BVBA Creating PDF/UA, PDF/A-3, ZUGFeRD
  • 45. © 2014, iText Group NV, iText Software Corp., iText Software BVBA Step 1. Create PDF PDF PDF is dead; Long live PDF... and Java!45
  • 46. © 2014, iText Group NV, iText Software Corp., iText Software BVBA Step1. Create PDF: Initialize document Document document = new Document(); PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream("SimplePdf.pdf")); writer.setPdfVersion(PdfWriter.VERSION_1_7); document.open(); PDF is dead; Long live PDF... and Java!46
  • 47. © 2014, iText Group NV, iText Software Corp., iText Software BVBA Step1. Create PDF: Add elements Paragraph p = new Paragraph(); Chunk c = new Chunk("The quick brown "); p.add(c); Image i = Image.getInstance("fox.bmp"); c = new Chunk(i, 0, -24); p.add(c); c = new Chunk(" jumps over the lazy "); p.add(c); i = Image.getInstance("dog.bmp"); c = new Chunk(i, 0, -24); p.add(c); document.add(p); PDF is dead; Long live PDF... and Java!47
  • 48. © 2014, iText Group NV, iText Software Corp., iText Software BVBA Step 1. Create PDF: Close document document.close(); PDF is dead; Long live PDF... and Java!48
  • 49. © 2014, iText Group NV, iText Software Corp., iText Software BVBA Step 1. Create PDF: Result PDF is dead; Long live PDF... and Java!49
  • 50. © 2014, iText Group NV, iText Software Corp., iText Software BVBA Step 2. Create Tagged PDF PDF is dead; Long live PDF... and Java!50 PDF Tagged content Tagged PDF
  • 51. © 2014, iText Group NV, iText Software Corp., iText Software BVBA Step 2. Create Tagged PDF PdfWriter writer = PdfWriter.getInstance(…); writer.setPdfVersion(PdfWriter.VERSION_1_7); writer.setTagged(); document.open(); PDF Tagged content Tagged PDF PDF is dead; Long live PDF... and Java!51
  • 52. © 2014, iText Group NV, iText Software Corp., iText Software BVBA Step 2. Create Tagged PDF PDF is dead; Long live PDF... and Java!52 PDF Tagged content Tagged PDF
  • 53. © 2014, iText Group NV, iText Software Corp., iText Software BVBA Step 3. Create PDF/UA PDF is dead; Long live PDF... and Java!53 Tagged PDF Metadata Font embedding Alt text PDF/UA
  • 54. © 2014, iText Group NV, iText Software Corp., iText Software BVBA Step 3. Create PDF/UA Goals Provide document title, author, keywords Provide document language for better accessibility Identify “type” of PDF (PDF/UA) to help PDF reader PDF is dead; Long live PDF... and Java!54 Tagged PDF Metadata Font embedding Alt text PDF/UA
  • 55. © 2014, iText Group NV, iText Software Corp., iText Software BVBA Step 3. Create PDF/UA writer.setTagged(); writer.setViewerPreferences (PdfWriter.DisplayDocTitle); document.addLanguage("en-US"); document.addTitle("English pangram"); writer.createXmpMetadata(); document.open(); PDF is dead; Long live PDF... and Java!55 Tagged PDF Metadata Font embedding Alt text PDF/UA
  • 56. © 2014, iText Group NV, iText Software Corp., iText Software BVBA Step 3. Create PDF/UA PDF is dead; Long live PDF... and Java!56 Tagged PDF Metadata Font embedding Alt text PDF/UA
  • 57. © 2014, iText Group NV, iText Software Corp., iText Software BVBA Step 3. Create PDF/UA Goals Make document independent of font set of current OS Make document independent of font selection strategy of PDF reader Make document fully portable PDF is dead; Long live PDF... and Java!57 Tagged PDF Metadata Font embedding Alt text PDF/UA
  • 58. © 2014, iText Group NV, iText Software Corp., iText Software BVBA Step 3. Create PDF/UA document.open(); Paragraph p = new Paragraph(); p.setFont(FontFactory.getFont("FreeSans.ttf", BaseFont.WINANSI, BaseFont.EMBEDDED, 20)); Chunk c = new Chunk("The quick brown "); p.add(c); PDF is dead; Long live PDF... and Java!58 Tagged PDF Metadata Font embedding Alt text PDF/UA
  • 59. © 2014, iText Group NV, iText Software Corp., iText Software BVBA Step 3. Create PDF/UA PDF is dead; Long live PDF... and Java!59 Tagged PDF Metadata Font embedding Alt text PDF/UA Before After
  • 60. © 2014, iText Group NV, iText Software Corp., iText Software BVBA Step 3. Create PDF/UA PDF is dead; Long live PDF... and Java!60 Tagged PDF Metadata Font embedding Alt text PDF/UA
  • 61. © 2014, iText Group NV, iText Software Corp., iText Software BVBA Step 3. Create PDF/UA Goals Provide alternate text for non-textual content Help conforming readers to read out loud the non-textual content PDF is dead; Long live PDF... and Java!61 Tagged PDF Metadata Font embedding Alt text PDF/UA
  • 62. © 2014, iText Group NV, iText Software Corp., iText Software BVBA Step 3. Create PDF/UA Image i = Image.getInstance("fox.bmp"); c = new Chunk(i, 0, -24); c.setAccessibleAttribute(PdfName.ALT, new PdfString("Fox")); p.add(c); PDF is dead; Long live PDF... and Java!62 Tagged PDF Metadata Font embedding Alt text PDF/UA
  • 63. © 2014, iText Group NV, iText Software Corp., iText Software BVBA Step 3. Create PDF/UA PDF is dead; Long live PDF... and Java!63 Tagged PDF Metadata Font embedding Alt text PDF/UA
  • 64. © 2014, iText Group NV, iText Software Corp., iText Software BVBA Step 3. Create PDF/UA PDF is dead; Long live PDF... and Java!64 Tagged PDF Metadata Font embedding Alt text PDF/UA
  • 65. © 2014, iText Group NV, iText Software Corp., iText Software BVBA Step 4. Create PDF/A-3b PDF is dead; Long live PDF... and Java!65 PDF Metadata Font embedding Output intents PDF/A-3b
  • 66. © 2014, iText Group NV, iText Software Corp., iText Software BVBA Step 4. Create PDF/A-3b Document document = new Document(); PdfAWriter writer = PdfAWriter.getInstance(document, new FileOutputStream("PdfA3b.pdf"), PdfAConformanceLevel.PDF_A_3B); writer.setPdfVersion(PdfWriter.VERSION_1_7); PDF is dead; Long live PDF... and Java!66 PDF Metadata Font embedding Output intents PDF/A-3b
  • 67. © 2014, iText Group NV, iText Software Corp., iText Software BVBA Step 4. Create PDF/A-3b Goals Identify “type” of PDF (PDF/A) to help PDF reader Similar iText code as for PDF/UA PDF is dead; Long live PDF... and Java!67 PDF Metadata Font embedding Output intents PDF/A-3b
  • 68. © 2014, iText Group NV, iText Software Corp., iText Software BVBA Step 4. Create PDF/A-3b PDF is dead; Long live PDF... and Java!68 PDF Metadata Font embedding Output intents PDF/A-3b
  • 69. © 2014, iText Group NV, iText Software Corp., iText Software BVBA Step 4. Create PDF/A-3b Goals Make document fully self contained and archivable Same iText code as for PDF/UA PDF is dead; Long live PDF... and Java!69 PDF Metadata Font embedding Output intents PDF/A-3b
  • 70. © 2014, iText Group NV, iText Software Corp., iText Software BVBA Step 4. Create PDF/A-3b Goals Match color characteristics of PDF document with color characteristics of device on which it is intended to be rendered Make colors device independent PDF is dead; Long live PDF... and Java!70 PDF Metadata Font embedding Output intents PDF/A-3b
  • 71. © 2014, iText Group NV, iText Software Corp., iText Software BVBA Step 4. Create PDF/A-3b document.open(); ICC_Profile icc = ICC_Profile.getInstance(new FileInputStream("sRGB Color Space Profile.icm")); writer.setOutputIntents("Custom", "", "http://www.color.org", "sRGB IEC61966-2.1", icc); Paragraph p = new Paragraph(); PDF is dead; Long live PDF... and Java!71 PDF Metadata Font embedding Output intents PDF/A-3b
  • 72. © 2014, iText Group NV, iText Software Corp., iText Software BVBA Step 4. Create PDF/A-3b PDF is dead; Long live PDF... and Java!72 PDF Metadata Font embedding Output intents PDF/A-3b
  • 73. © 2014, iText Group NV, iText Software Corp., iText Software BVBA Step 4. Create PDF/A-3b PDF is dead; Long live PDF... and Java!73 PDF Metadata Font embedding Output intents PDF/A-3b
  • 74. © 2014, iText Group NV, iText Software Corp., iText Software BVBA Step 5. Create PDF/A-3a PDF is dead; Long live PDF... and Java!74 PDF/A- 3b PDF/UA PDF/A- 3a
  • 75. © 2014, iText Group NV, iText Software Corp., iText Software BVBA Step 5. Create PDF/A-3a Document document = new Document(); PdfAWriter writer = PdfAWriter.getInstance(document, new FileOutputStream("PdfA3a.pdf"), PdfAConformanceLevel.PDF_A_3A); writer.setPdfVersion(PdfWriter.VERSION_1_7); PDF is dead; Long live PDF... and Java!75 PDF/A- 3b PDF/UA PDF/A- 3a
  • 76. © 2014, iText Group NV, iText Software Corp., iText Software BVBA Step 5. Create PDF/A-3a PDF is dead; Long live PDF... and Java!76 PDF/A- 3b PDF/UA PDF/A- 3a
  • 77. © 2014, iText Group NV, iText Software Corp., iText Software BVBA Step 5. Create PDF/A-3a Can I make sure that my document is compliant? iText will: Perform a lot of checks, from technical PoV, based on the requested conformance level Throw an exception if a requirement is not met Not everything can be checked automatically! PDF is dead; Long live PDF... and Java!77 PDF/A- 3b PDF/UA PDF/A- 3a
  • 78. © 2014, iText Group NV, iText Software Corp., iText Software BVBA Step 5. Create PDF/A-3a PDF is dead; Long live PDF... and Java!78 PDF/A- 3b PDF/UA PDF/A- 3a
  • 79. © 2014, iText Group NV, iText Software Corp., iText Software BVBA Create ZUGFeRD invoices PDF is dead; Long live PDF... and Java!79 PDF/A-3b XMP metadata Invoice attachment ZUGFeRD PDF
  • 80. © 2014, iText Group NV, iText Software Corp., iText Software BVBA Create ZUGFeRD invoices Document document = new Document(); PdfAWriter writer = PdfAWriter.getInstance(document, new FileOutputStream("Zugferd.pdf"), PdfAConformanceLevel.ZUGFeRD); writer.setPdfVersion(PdfWriter.VERSION_1_7); PDF is dead; Long live PDF... and Java!80 PDF/A-3b XMP metadata Invoice attachment ZUGFeRD PDF
  • 81. © 2014, iText Group NV, iText Software Corp., iText Software BVBA Create ZUGFeRD invoices writer.createXmpMetadata(); writer.getXmpWriter().setProperty( PdfAXmpWriter.zugferdSchemaNS, PdfAXmpWriter.zugferdDocumentFileName, "invoice.xml"); document.open(); PDF is dead; Long live PDF... and Java!81 PDF/A-3b XMP metadata Invoice attachment ZUGFeRD PDF
  • 82. © 2014, iText Group NV, iText Software Corp., iText Software BVBA Create ZUGFeRD invoices PdfFileSpecification fileSpec = writer.addFileAttachment("ZUGFeRD invoice", null, "c:/invoice.xml", "invoice.xml", "application/xml", new AFRelationshipValue.Alternative); PDF is dead; Long live PDF... and Java!82 PDF/A-3b XMP metadata Invoice attachment ZUGFeRD PDF
  • 83. © 2014, iText Group NV, iText Software Corp., iText Software BVBA Create ZUGFeRD invoices PDF is dead; Long live PDF... and Java!83 PDF/A-3b XMP metadata Invoice attachment ZUGFeRD PDF
  • 84. © 2014, iText Group NV, iText Software Corp., iText Software BVBA© 2014, iText Group NV, iText Software Corp., iText Software BVBA The DNA of PDF The Structure of a PDF file Looking at a PDF from a text editor Browsing Java objects using Java Swing
  • 85. © 2014, iText Group NV, iText Software Corp., iText Software BVBA The structure of a PDF file PDF is dead; Long live PDF... and Java!85 Header Body Cross-Reference Table Trailer
  • 86. © 2014, iText Group NV, iText Software Corp., iText Software BVBA Demo-time PDF is dead; Long live PDF... and Java!86
  • 87. © 2014, iText Group NV, iText Software Corp., iText Software BVBA© 2014, iText Group NV, iText Software Corp., iText Software BVBA Finding Structure in PDF
  • 88. © 2014, iText Group NV, iText Software Corp., iText Software BVBA Listener for text snippets public class MyTextRenderListener implements RenderListener { public void beginTextBlock() { System.out.println("<"); } public void endTextBlock() { System.out.println(">"); } public void renderImage(ImageRenderInfo renderInfo) { } public void renderText(TextRenderInfo renderInfo) { System.out.println(" <"); Vector start = renderInfo.getBaseline().getStartPoint(); System.out.println(String.format(" x: %s y: %s length: %s n Text: %s", start.get(Vector.I1), start.get(Vector.I2), renderInfo.getBaseline().getLength(), renderInfo.getText())); out.println(" >"); } } PDF is dead; Long live PDF... and Java!88
  • 89. © 2014, iText Group NV, iText Software Corp., iText Software BVBA Parsing PDF PdfReader reader = new PdfReader(src); RenderListener listener = new MyTextRenderListener(); PdfContentStreamProcessor processor = new PdfContentStreamProcessor(listener); PdfDictionary pageDic = reader.getPageN(1); PdfDictionary resourcesDic = pageDic.getAsDict(PdfName.RESOURCES); processor.processContent( ContentByteUtils.getContentBytesForPage(reader, 1), resourcesDic); reader.close(); PDF is dead; Long live PDF... and Java!89
  • 90. © 2014, iText Group NV, iText Software Corp., iText Software BVBA Example page to parse PDF is dead; Long live PDF... and Java!90
  • 91. © 2014, iText Group NV, iText Software Corp., iText Software BVBA Providing hints PDF is dead; Long live PDF... and Java!91
  • 92. © 2014, iText Group NV, iText Software Corp., iText Software BVBA Providing hints PDF is dead; Long live PDF... and Java!92
  • 93. © 2014, iText Group NV, iText Software Corp., iText Software BVBA Providing hints PDF is dead; Long live PDF... and Java!93
  • 94. © 2014, iText Group NV, iText Software Corp., iText Software BVBA Demo Finding text snippets Finding text lines Finding text structure PDF is dead; Long live PDF... and Java!94
  • 95. © 2014, iText Group NV, iText Software Corp., iText Software BVBA© 2014, iText Group NV, iText Software Corp., iText Software BVBA Wrapping up The Technical Roadmap for iText Further reading Q&A
  • 96. © 2014, iText Group NV, iText Software Corp., iText Software BVBA Roadmap 2012 Mobile versus Cloud Android version Google App Engine (GAE) Version Digital Signatures Update to new specs Documentation XML Worker / XFA Worker Generic XML to PDF engine Test with HTML, target XFA PDF is dead; Long live PDF... and Java!96
  • 97. © 2014, iText Group NV, iText Software Corp., iText Software BVBA Roadmap 2013 Creating Tagged PDF From high-level objects From XFA Worker Focus on standards Rewriting the PDF/A functionality Introducing PDF/UA support PAdES 5 XML-DSig + XAdES PDF is dead; Long live PDF... and Java!97
  • 98. © 2014, iText Group NV, iText Software Corp., iText Software BVBA Roadmap 2014 Major upgrade for RUPS Reading and Updating PDF Syntax XFA Worker: Enterprise-grade solution Support for JavaScript Standards Complete PDF/UA Complete PDF/A-2, PDF/A-3, ZUGFeRD PDF is dead; Long live PDF... and Java!98
  • 99. © 2014, iText Group NV, iText Software Corp., iText Software BVBA Roadmap 2015 Customer-driven development E.g. “Redaction” Unstructured PDFs Turn our research into development PDF 2.0 Making iText ready for PDF 2.0 Next ISO Committee meeting: November 2014, Edinburgh PDF is dead; Long live PDF... and Java!99
  • 100. © 2014, iText Group NV, iText Software Corp., iText Software BVBA Books published by Manning PDF is dead; Long live PDF... and Java!100 1st Edition: 2006 • 11.500 copies 2nd Edition: 2010 • 8.000 copies
  • 101. © 2014, iText Group NV, iText Software Corp., iText Software BVBA New book in the making PDF is dead; Long live PDF... and Java!101
  • 102. © 2014, iText Group NV, iText Software Corp., iText Software BVBA Upcoming titles PDF is dead; Long live PDF... and Java!102
  • 103. © 2014, iText Group NV, iText Software Corp., iText Software BVBA PDF is dead; Long live PDF... and Java!103 Thank you! Questions and answers Visit us at booth #5712