Commit 00cf64b5 authored by Alain Vagner's avatar Alain Vagner

set the default language

parent 14431d45
Pipeline #851 passed with stages
in 1 minute and 14 seconds
......@@ -48,6 +48,13 @@ class PostProcesser extends EventEmitter {
new PDFLib.PDFDictionary({ DisplayDocTitle: PDFLib.PDFBoolean.fromBool(true) }, PDFLib.PDFObjectIndex.create()));
}
// Set the default language of the document
// See PDF/UA 1: 7.2-3
// See Matterhorn Protocol 1.1: Index 11-006
if (meta.lang) {
this.pdfDoc.catalog.set("Lang", PDFLib.PDFString.fromString(meta.lang));
}
// Add meta
this.addXmpMetadata(meta);
this.updateInfoDict(meta);
......
......@@ -303,6 +303,10 @@ class Printer extends EventEmitter {
if (title) {
meta.title = title.textContent.trim();
}
let lang = document.querySelector("html").getAttribute("lang");
if (lang) {
meta.lang = lang;
}
let metaTags = document.querySelectorAll("meta");
[...metaTags].forEach((tag) => {
if (tag.name) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment