Free Support Forum - aspose.com

Set default document language for PDF using Aspose.PDF for .NET

Hi,
is it possible to set the language property which is displayed under File -> Properties -> Advanced in Acrobat Reader. I am using Aspose.Pdf for .net
LanguageProperty.png (22.5 KB)

@hnbe

At this moment, Aspose.PDF for .NET API allows you to set language and title for a document according to specification PDF/UA. The language can be set up for whole document as well as for its separate structural elements.

We tried to set the language using following code snippet and noticed that it did not come up in the properties section as shown in the image by you.

Document document = new Document();

// Get TaggedContent
Tagged.ITaggedContent taggedContent = document.TaggedContent;

// Set Title and Language
taggedContent.SetTitle("Example Tagged Document");
taggedContent.SetLanguage("en-US");

// Header (en-US, inherited from document)
LogicalStructure.HeaderElement h1 = taggedContent.CreateHeaderElement(1);
h1.SetText("Phrase on different languages");
taggedContent.RootElement.AppendChild(h1);
// Save Tagged Pdf Document
document.Save(dataDir + "SetupLanguageAndTitle.pdf");

Therefore, an investigation ticket as PDFNET-49057 has been logged in our issue tracking system for the sake of further analysis. We will look into its details and keep you posted with the status of its rectification. Please be patient and spare us some time.

We are sorry for the inconvenience.