[Feature] Support DjVu metadata (#4314)

pull/4320/head
xelxebar 6 years ago committed by Frans de Jonge
parent f71627cf1d
commit 05e687f570

@ -1 +1 @@
Subproject commit bcd8ba4e744c58aa504e8031669c1ab96cacfc1e
Subproject commit b027efb11a3e6412ab2a6c0ba848764c82c36dc2

@ -54,11 +54,20 @@ function DjvuDocument:updateColorRendering()
end
function DjvuDocument:getProps()
local props = self._document:getMetadata()
local _, _, docname = self.file:find(".*/(.*)")
docname = docname or self.file
return {
title = docname:match("(.*)%.")
}
-- According to djvused(1), the convention is that
-- BibTex keys are always lowercase and DocInfo capitalized
props.title = props.title or props.Title or docname:match("(.*)%.")
props.authors = props.author or props.Author
props.series = props.series or props.Series
props.language = props.language or props.Language
props.keywords = props.keywords or props.Keywords
props.description = props.description or props.Description
return props
end
function DjvuDocument:getPageTextBoxes(pageno)

Loading…
Cancel
Save