PDF/UA (universal accessibility) is an ISO standard (ISO 14289) that defines requirements for universally accessible PDF documents. It ensures PDFs are fully accessible to users with disabilities, including those using assistive technologies like screen readers.

This sample demonstrates how to convert a standard PDF document to PDF/UA format using Nutrient Java SDK. Compliance is essential for organizations committed to digital inclusion and legal compliance with accessibility regulations such as:

  • Americans with Disabilities Act (ADA)
  • Section 508
  • Web Content Accessibility Guidelines (WCAG)

The conversion process automatically handles document structure tagging, heading hierarchy establishment, reading order optimization, and other enhancements required for full compliance.

Streamlining document workflows with our Java SDK

Developers can implement this feature by adding a few lines of code to their applications. The SDK integrates PDF-to-PDF/UA conversion directly, which removes the requirement for external tools or complex setups. Our SDK provides a reliable solution for building accessible document systems or adding compliance functionality to an existing platform.

Preparing the project

Specify a package name and create a new class for the task:

package io.nutrient.Sample;

Import Nutrient Java SDK. While you can use a wildcard, it’s recommended to specify the actual classes:

import io.nutrient.sdk.Document;
import io.nutrient.sdk.enums.PdfConformance;
import io.nutrient.sdk.exceptions.NutrientException;
import io.nutrient.sdk.settings.PdfSettings;
public class PdfToPdfUa {

Create the main function and specify that it can throw a NutrientException. You can also catch this exception within your program logic for custom error management:

public static void main(String[] args) throws NutrientException {

With the Java environment set up, you can now focus on the SDK-specific implementation.

Loading the PDF document

This guide focuses on the Document class. Initialize Document using a try-with-resources(opens in a new tab) statement to ensure proper lifecycle management of the document instance.

The SDK supports multiple integration methods to provide flexibility in how you connect with your application. You can specify the source file via a file path or a stream. This guide uses a file path as the source:

try (Document document = Document.open("input.pdf")) {

This path can be either absolute or relative. In this example, the file is loaded from the application’s working directory.

Converting to PDF/UA format

Configure the PDF settings to target PDF/UA-1 conformance level. Then export the document:

PdfSettings pdfSettings = document.getSettings().getPdfSettings();
pdfSettings.setConformance(PdfConformance.PDF_UA_1);
document.exportAsPdf("output.pdf");
}
}
}

The setConformance method configures the output to meet PDF/UA-1 standards, ensuring the document is fully accessible to users with disabilities. The exportAsPdf method then generates a compliant PDF/UA document.

The conversion process automatically performs these actions:

  • Analyzes document structure and creates appropriate tags.
  • Ensures proper reading order for screen readers.
  • Adds alternative text for images and graphics.
  • Validates color contrast and text accessibility.
  • Generates a PDF/UA-compliant document for full assistive technology support.

PDF/UA requirements

The PDF/UA conversion automatically implements several key accessibility requirements:

  • Document structure — Creates a logical document structure with a proper heading hierarchy.
  • Tagged content — Tags all content elements for assistive technology interpretation.
  • Alternative text — Ensures images and non-text elements have appropriate descriptions.
  • Font embedding — Embeds all fonts to ensure consistent text rendering.
  • Reading order — Establishes a logical reading sequence for document navigation.

Accessibility features

PDF/UA documents provide enhanced accessibility through:

  • Screen reader support — Structured content enables accurate text-to-speech conversion.
  • Keyboard navigation — Proper tab order and navigation structure for users who cannot use a mouse.
  • Zoom compatibility — Text and layout scale appropriately for users with visual impairments.
  • Language identification — Proper language tagging for multilingual content.

Error handling

Nutrient Java SDK handles errors with exception handling. Both methods presented in this guide throw a NutrientException if a failure occurs. This helps with troubleshooting and implementing error handling logic.

Conclusion

That’s all it takes to convert a PDF document into an accessible PDF/UA file. The resulting document complies with international accessibility standards and enables universal access for users with disabilities. You can also download this ready-to-use sample package, which is configured to help you explore the Java SDK and accessibility conversion capabilities.