MCPcopy Create free account
hub / github.com/LibPDF-js/core / getLanguage

Method getLanguage

src/api/pdf.ts:1413–1417  ·  view source on GitHub ↗

* Get the document language. * * Note: Unlike other metadata, language is stored in the Catalog, not Info. * * @returns RFC 3066 language tag, or undefined if not set

()

Source from the content-addressed store, hash-verified

1411 * @returns RFC 3066 language tag, or undefined if not set
1412 */
1413 getLanguage(): string | undefined {
1414 const catalog = this.ctx.catalog.getDict();
1415
1416 return catalog.getString("Lang")?.asString();
1417 }
1418
1419 /**
1420 * Set the document language.

Callers 5

getMetadataMethod · 0.95
pdf.test.tsFile · 0.80
mainFunction · 0.80
mainFunction · 0.80
mainFunction · 0.80

Calls 3

asStringMethod · 0.80
getDictMethod · 0.65
getStringMethod · 0.45

Tested by

no test coverage detected