1

How can I add metadata to a DjVu file?

Desired result:

$ exiftool sample.djvu | grep -P "^===|Title|Author"
Title                           : Group Theory and Physics
Author                          : Shlomo Sternberg

It sounds like XMP metadata would do the trick:

$ djvused sample.djvu -e 'set-xmp sample.xmp'

Though I'm unsure how to create the XMP file itself -- and examples on the internet are sparse.

Mateen Ulhaq
  • 111
  • 3

1 Answers1

1

You don't need xmp to set a simple metadata for a document. Just create a text file, (for ex. "meta.txt") with following content:

"author" "Author Name"
"title" "Book title"
"software"  "djvused"

And set it as document metadata with djvused -s -e "select ; set-meta meta.txt" my.djvu That will set document metadata. To set page-specific metadata to page number 5, for ex. you shall change "select ; set-meta meta.txt" to "select 5; set-meta meta.txt".

The meta.txt file format is a space(s) delimeted "key" "value" pairs, each on a new line.

truf
  • 141
  • 5