Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}
}
const authors = doc.getAttribute('authors', '')
const publisher = doc.getAttribute('publisher', '')
const creator = `Asciidoctor PDF ${pkg.version}`
pdfDoc.setTitle(doc.getDocumentTitle({ use_fallback: true }))
pdfDoc.setAuthor(authors)
pdfDoc.setSubject(doc.getAttribute('subject', ''))
pdfDoc.setKeywords(doc.getAttribute('keywords', '').split(','))
pdfDoc.setProducer(publisher || authors || creator)
pdfDoc.setCreator(creator)
pdfDoc.setCreationDate(creationDate)
pdfDoc.setModificationDate(modificationDate)
if (!doc.hasAttribute('nolang')) {
const lang = doc.getAttribute('lang', 'en')
pdfDoc.catalog.set(PDFName.of('Lang'), PDFString.of(lang))
}
return pdfDoc
}