SetDocumentLanguage

Document properties, Accessibility

Description

Sets the document's natural language in the PDF Catalog (/Lang entry). The language declaration is used by screen readers and other assistive technology to apply correct pronunciation and text-to-speech rules.

This function writes the Catalog /Lang key directly. When using PDF/UA mode, the language should instead be supplied via the SetPDFUAMode Language parameter, which calls this function internally.

Syntax

Delphi

function TPDFlib.SetDocumentLanguage(const Language: WideString): Integer;

ActiveX

Function PDFlib::SetDocumentLanguage(Language As String) As Long

DLL

int DLSetDocumentLanguage(int InstanceID, wchar_t* Language);
int DLSetDocumentLanguageA(int InstanceID, char* Language);

Parameters

LanguageBCP 47 language tag, e.g. "en-US", "fr", "zh-TW". Must be non-empty.

Return values

0Language string was empty; no change was made
1Language was set successfully