Creating accessible PDF documents

Universal Accessibility with PDF/UA

Highlights for Universal Accessibility

  • Making documents universally accessible means ensuring that everyone has access to all information in a document.
  • Universal accessibility for PDF documents can be achieved by complying to the PDF/UA standard which has the aim to provide everyone with equal access to all information in a document.
  • Some of the most impactful PDF/UA requirements are tagged PDF, alternate descriptions, language identifiers and embedded fonts.
  • Universal accessibility offers universal benefits for users with and without disabilities
  • PDF/UA makes it easy to comply with accessibility regulations across the globe such as ADA, EAA, AODA and so on.
  • The iText 7 SDK/Library lets you create and manipulate Tagged PDF in Java and .NET (C#), Add language specifier, set the title, embed fonts and add alt text.
  • iText DITO’s wizard lets you automatically validate your templates for PDF/UA and suggest actions to make compliant documents.

Why make PDF documents accessible

Whether you look at your company’s internal or public facing documents, many of them are bound to be PDFs; the PDF format makes up about 90% of published digital documents today. And in a world where digital documents are often the sole source of information available, it is important that everyone has equal access to all the information in those documents. That is exactly what PDF/UA – the PDF standard for Universal Accessibility – aims to do. 

Technical requirements of PDF/UA

The requirements particularly focus on including those with disabilities that make use of assistive technology (AT), such as screen readers and braille displays, but also input devices ranging from adaptive keyboards to eye-tracking software. The current PDF/UA-1 standard specified in ISO 14289-1:2014, is based on PDF 1.7 and adds some additional requirements and constraints to ensure accessibility.

One of the most impactful requirements is that all meaningful content should be tagged. Tags identify each element of a PDF, for example a header, a table, or an image. Together, these tags form a hierarchical structure tree and the order of the tags sets the reading order of the document. A full list of requirements can be found in the free PDF/UA ebook we produced, though we have summarized the key points here.

itext stripes
Tagged PDF

All meaningful content needs to be tagged in a logical and semantically correct way. All other content is identified as an artifact.

Language Identifiers

The main language of the document and any changes in language throughout the document should be marked.

Embedded fonts

Fonts must be embedded and Unicode mapped

Alternate descriptions

Images that convey meaning must contain alternative descriptions and must be tagged with a Figure tag.

Universal Benefits of PDF/UA

While the biggest stakeholders for accessibility are the over 1 billion people with disabilities worldwide, PDF/UA can benefit both users with and without disabilities. Just think about how frustrating it can be to read an inaccessible PDF on your mobile phone. The structural requirements of PDF/UA allow for better machine reading capabilities, that can allow for efficient reflow of a document on diverging screen sizes, but can also improve your PDF to HTML conversion, SEO (Search Engine Optimization), and everyday text-to-speech applications. You can read more about the benefits for all users in our blog.

Image
Responsive PDF

Accessibility Regulations

Does anybody still need convincing? Well, providing accessible documents is not just a moral consideration, but one often mandated by law. One such law addressing the accessibility of all publicly available content, is the Americans with Disabilities Act (ADA). In 2020 alone, approximately 11,000 ADA lawsuits related to accessibility of private businesses were filed, of which 3,500 relate to digital accessibility. With settlements for individual plaintiffs often adding up to thousands of dollars, inaccessible documents can become a major liability for your organization, and not just in the USA (ADA and Section 508).

The EU has the EU Web Accessibility Directive and the European Accessibility Act (EAA), The UK has the Disability Discrimination Act and Canada has several such as AODA. And the list goes on, so be sure to check for your local regulations in our free ebook “PDF/UA: the inclusive document format”.

Image
pdfua regulations

Make PDF/UA compliance scalable with iText

Text offers you solutions to achieve PDF/UA compliance in a scalable way, both within the open-source iText 7 Core library and the visual designer iText DITO.

iText 7 Library/SDK

iText 7 Core provides developers with the necessary tools to automate the creation of accessible PDFs in both Java and .NET (C#). With just a few lines of code you can meet the following PDF/UA requirements in your workflows:

  • Create and manipulate Tagged PDF
  • Add a language specifier
  • Set the title of the document to display in the title bar
  • Embed fonts
  • Set alt text

Code example for creating a PDF/UA compliant document

package com.itextpdf.samples.sandbox.pdfua; import com.itextpdf.io.font.PdfEncodings; import com.itextpdf.io.image.ImageDataFactory; import com.itextpdf.kernel.font.PdfFont; import com.itextpdf.kernel.font.PdfFontFactory; import com.itextpdf.kernel.font.PdfFontFactory.EmbeddingStrategy; import com.itextpdf.kernel.geom.PageSize; import com.itextpdf.kernel.pdf.PdfDocument; import com.itextpdf.kernel.pdf.PdfDocumentInfo; import com.itextpdf.kernel.pdf.PdfString; import com.itextpdf.kernel.pdf.PdfVersion; import com.itextpdf.kernel.pdf.PdfViewerPreferences; import com.itextpdf.kernel.pdf.PdfWriter; import com.itextpdf.kernel.pdf.WriterProperties; import com.itextpdf.kernel.xmp.XMPException; import com.itextpdf.layout.Document; import com.itextpdf.layout.element.Image; import com.itextpdf.layout.element.List; import com.itextpdf.layout.element.ListItem; import com.itextpdf.layout.element.Paragraph; import java.io.File; import java.io.FileInputStream; import java.io.IOException; public class PdfUA { public static final String DEST = "./target/sandbox/pdfua/pdf_ua.pdf"; public static final String DOG = "./src/main/resources/img/dog.bmp"; public static final String FONT = "./src/main/resources/font/FreeSans.ttf"; public static final String FOX = "./src/main/resources/img/fox.bmp"; public static void main(String[] args) throws Exception { File file = new File(DEST); file.getParentFile().mkdirs(); new PdfUA().manipulatePdf(DEST); } public void manipulatePdf(String dest) throws IOException { PdfDocument pdfDoc = new PdfDocument(new PdfWriter(dest, new WriterProperties().addUAXmpMetadata().setPdfVersion(PdfVersion.PDF_1_7))); Document document = new Document(pdfDoc, PageSize.A4.rotate()); //TAGGED PDF //Make document tagged pdfDoc.setTagged(); //PDF/UA //Set document metadata pdfDoc.getCatalog().setViewerPreferences(new PdfViewerPreferences().setDisplayDocTitle(true)); pdfDoc.getCatalog().setLang(new PdfString("en-US")); PdfDocumentInfo info = pdfDoc.getDocumentInfo(); info.setTitle("English pangram"); Paragraph p = new Paragraph(); //PDF/UA //Embed font PdfFont font = PdfFontFactory.createFont(FONT, PdfEncodings.WINANSI, EmbeddingStrategy.PREFER_EMBEDDED); p.setFont(font); p.add("The quick brown "); Image img = new Image(ImageDataFactory.create(FOX)); //PDF/UA //Set alt text img.getAccessibilityProperties().setAlternateDescription("Fox"); p.add(img); p.add(" jumps over the lazy "); img = new Image(ImageDataFactory.create(DOG)); //PDF/UA //Set alt text img.getAccessibilityProperties().setAlternateDescription("Dog"); p.add(img); document.add(p); p = new Paragraph("\n\n\n\n\n\n\n\n\n\n\n\n").setFont(font).setFontSize(20); document.add(p); List list = new List().setFont(font).setFontSize(20); list.add(new ListItem("quick")); list.add(new ListItem("brown")); list.add(new ListItem("fox")); list.add(new ListItem("jumps")); list.add(new ListItem("over")); list.add(new ListItem("the")); list.add(new ListItem("lazy")); list.add(new ListItem("dog")); document.add(list); document.close(); } }
using System; using System.IO; using iText.IO.Font; using iText.IO.Image; using iText.Kernel.Font; using iText.Kernel.Geom; using iText.Kernel.Pdf; using iText.Layout; using iText.Layout.Element; namespace iText.Samples.Sandbox.Pdfua { public class PdfUA { public static readonly string DEST = "results/sandbox/pdfua/pdf_ua.pdf"; public static readonly String DOG = "../../../resources/img/dog.bmp"; public static readonly String FONT = "../../../resources/font/FreeSans.ttf"; public static readonly String FOX = "../../../resources/img/fox.bmp"; public static void Main(String[] args) { FileInfo file = new FileInfo(DEST); file.Directory.Create(); new PdfUA().ManipulatePdf(DEST); } private void ManipulatePdf(String dest) { PdfDocument pdfDoc = new PdfDocument(new PdfWriter(dest, new WriterProperties().AddUAXmpMetadata().SetPdfVersion (PdfVersion.PDF_1_7))); Document document = new Document(pdfDoc, PageSize.A4.Rotate()); //TAGGED PDF //Make document tagged pdfDoc.SetTagged(); //PDF/UA //Set document metadata pdfDoc.GetCatalog().SetViewerPreferences(new PdfViewerPreferences().SetDisplayDocTitle(true)); pdfDoc.GetCatalog().SetLang(new PdfString("en-US")); PdfDocumentInfo info = pdfDoc.GetDocumentInfo(); info.SetTitle("English pangram"); Paragraph p = new Paragraph(); //PDF/UA //Embed font PdfFont font = PdfFontFactory.CreateFont(FONT, PdfEncodings.WINANSI, PdfFontFactory.EmbeddingStrategy.PREFER_EMBEDDED); p.SetFont(font); p.Add("The quick brown "); Image img = new Image(ImageDataFactory.Create(FOX)); //PDF/UA //Set alt text img.GetAccessibilityProperties().SetAlternateDescription("Fox"); p.Add(img); p.Add(" jumps over the lazy "); img = new Image(ImageDataFactory.Create(DOG)); //PDF/UA //Set alt text img.GetAccessibilityProperties().SetAlternateDescription("Dog"); p.Add(img); document.Add(p); p = new Paragraph("\n\n\n\n\n\n\n\n\n\n\n\n").SetFont(font).SetFontSize(20); document.Add(p); List list = new List().SetFont(font).SetFontSize(20); list.Add(new ListItem("quick")); list.Add(new ListItem("brown")); list.Add(new ListItem("fox")); list.Add(new ListItem("jumps")); list.Add(new ListItem("over")); list.Add(new ListItem("the")); list.Add(new ListItem("lazy")); list.Add(new ListItem("dog")); document.Add(list); document.Close(); } } }

iText DITO

With iText DITO you can visually design PDF templates and bind them with your data to simplify the process of creating and maintaining your documents. iText DITO will automatically validate your template against PDF/UA requirements where possible and suggest actions to make your template suitable for generating compliant documents.

itext dito pdfua wizard

Contact

Still have questions? 

We're happy to answer your questions. Reach out to us and we'll get back to you shortly.

Contact us
Stay updated

Join 11,000+ subscribers and become an iText PDF expert by staying up to date with our new products, updates, tips, technical solutions and happenings.

Subscribe Now