Generate tagged PDF using Aspose.PDF - Setting the Natural Language for document

Using Pdf DocumentInfo

How do I set the /Lang element for a pdf document in line with the pdf accessibility requirements detailed here: PDF16: Setting the default language using the /Lang entry in the document catalog of a PDF document | Techniques for WCAG 2.0

I have tried DocumentInfo.Add(“/Lang”, “en-US”)

And while this adds a custom property called /Lang it doesn’t get set as the natural language for the document.

Please can you advise what I need to do?

Thank you.

It seems like your requirements are related to generate Tagged PDF (508 compliant PDF). In case our assumption are correct, you may set language and title of a Accessible PDF by following the code snippet given in article. In case your requirements are different, please share a bit more details with us. We will further proceed to assist you accordingly.


I have followed the instructions in that article and while that does set the language for the TaggedContent it does not seem to set the language for the document, which means the document still reports as not having a language (see attached picture).

image.png (7.7 KB)

Please can you advise how I can set the document’s /LANG flag (which I understand is what Abobe is checking here).



Would you please share your sample PDF document along with the complete code that you have tried so far. We will test the scenario in our environment and address it accordingly.