mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-22 16:18:08 +02:00
[api-minor] Include the /Lang-property in the documentInfo
, and use it in the viewer (issue 14110)
*Please note:* This is a tentative patch, since I don't have the necessary a11y-software to actually test it. To avoid having to add a new API-method just for a single string, I figured that adding the new property to the existing `documentInfo`-data (accessed via `PDFDocumentProxy.getMetadata` in the API) will hopefully be deemed acceptable.
This commit is contained in:
parent
52fce0d17b
commit
00720d059a
4 changed files with 17 additions and 0 deletions
|
@ -812,6 +812,7 @@ const PDFViewerApplication = {
|
|||
const { container } = this.appConfig.errorWrapper;
|
||||
container.hidden = true;
|
||||
}
|
||||
this.appConfig.viewerContainer.removeAttribute("lang");
|
||||
|
||||
if (!this.pdfLoadingTask) {
|
||||
return;
|
||||
|
@ -1536,6 +1537,9 @@ const PDFViewerApplication = {
|
|||
`(PDF.js: ${version || "-"})`
|
||||
);
|
||||
|
||||
if (info.Language) {
|
||||
this.appConfig.viewerContainer.lang = info.Language;
|
||||
}
|
||||
let pdfTitle = info?.Title;
|
||||
|
||||
const metadataTitle = metadata?.get("dc:title");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue