Converting a document from DOCX to PDF/UA format
Converting Word documents (DOCX) to PDF/UA — whether for accessibility compliance, inclusive document creation, or meeting ISO 14289 standards — ensures content is accessible to all users, including those using assistive technologies like screen readers.
How Nutrient helps you achieve this
Nutrient .NET SDK handles DOCX-to-PDF/UA conversion. With the SDK, you don’t need to worry about:
- Parsing Word document structures
- Managing accessibility tagging
- Handling PDF/UA conformance requirements
- Complex rendering logic
Instead, Nutrient provides an API that handles all the complexity behind the scenes, letting you focus on your business logic.
Complete implementation
Below is a complete working example that demonstrates DOCX-to-PDF/UA conversion.
Import the Nutrient namespace:
using Nutrient;Open the Word document — the SDK converts Office formats transparently:
try{ using Document document = Document.Open("input.docx");Configure PDF/UA conformance and export the document. The PDF_UA_1 setting ensures the output meets ISO 14289 accessibility standards:
var settings = document.Settings; var pdfSettings = settings.PdfSettings; pdfSettings.Conformance = PdfConformance.PDF_UA_1;
document.ExportAsPdf("output.pdf"); Console.WriteLine("Successfully converted to PDF/UA");}catch (NutrientException e){ Console.Error.WriteLine($"Error: {e.Message}"); Environment.Exit(1);}Conclusion
The conversion logic consists of three steps:
- Open the document.
- Configure PDF/UA conformance.
- Export as PDF.
Nutrient handles Word document parsing and accessibility compliance so you don’t need to understand document internals or manage PDF tagging manually.
Error handling
Nutrient .NET SDK handles errors with exception handling. The methods presented in this guide throw a NutrientException if a failure occurs. This helps with troubleshooting and implementing error handling logic.