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 Python 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 Python 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

Import Nutrient Python SDK to get started:

from nutrient_sdk import Document
from nutrient_sdk import PdfConformance
from nutrient_sdk import NutrientException

Loading the PDF document

This guide focuses on the Document class. Use Python’s context manager(opens in a new tab) to ensure proper lifecycle management of the document instance.

The SDK supports multiple integration methods to provide flexibility when connecting 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:

def main():
try:
with Document.open("input.pdf") as document:

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:

pdf_settings = document.settings.pdf_settings
pdf_settings.set_conformance(PdfConformance.PDF_UA_1)
document.export_as_pdf("output.pdf")
print("Successfully converted to PDF/UA")
except NutrientException as e:
print(f"Error: {e}")
if __name__ == "__main__":
main()

The set_conformance method configures the output to meet PDF/UA-1 standards, ensuring the document is fully accessible to users with disabilities. The export_as_pdf 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 Python SDK handles errors with exception handling. The methods presented in this guide raise 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 fully configured to help you explore the Python SDK and its seamless accessibility conversion capabilities.