Forum Discussion
How to Create a PDF with proper tags for accessibility
Using Visual Studio
1 solution
3 projects
- A front end, using react for external users to submit (react)
- A front end for internal users for approvals (razor)
- A backend used by both (C#)
We are presently creating PDFs.
The PDFs are not Accessibility compliant.
We need to avoid licensing or service fees.
How can we create PDFs (ideally in the c# backed) that allows for tagging to ensure that the PDF's are accessibility standards compliant (e.g. WCAG)
Thank you!
1 Reply
You can keep PDF generation in the shared C# backend; React and Razor do not need separate PDF implementations. One candidate without a library license fee is Microsoft's MIT-licensed Playwright for .NET.
Create a dedicated HTML document from your application data, using meaningful headings, lists, table headers, language metadata and image descriptions. Render it with Chromium through Microsoft.Playwright, wait for the content and fonts to finish loading, then call Page.PdfAsync with PagePdfOptions.Tagged set to true. The documented Tagged option generates a tagged PDF and defaults to false.
Treat this as a generation approach, not a guarantee of WCAG or PDF/UA conformance. Inspect the resulting document's tag structure and reading order, test tables and links, and include manual assistive-technology checks. Validate representative output before adopting the pipeline.
You still need to budget for hosting and maintenance; a free library does not remove those costs or the need to assess accessibility.