Answers.Body: <p>You don't need xmp to set a simple metadata for a document. Just create a text file, (for ex. &quot;meta.txt&quot;) with following content:</p>
  <pre><code>&quot;author&quot; &quot;Author Name&quot;
  &quot;title&quot; &quot;Book title&quot;
  &quot;software&quot;  &quot;djvused&quot;
  </code></pre>
  <p>And set it as document metadata with <code>djvused -s -e &quot;select ; set-meta meta.txt&quot; my.djvu</code>
  That will set document metadata. To set page-specific metadata to page number 5, for ex. you shall change <code>&quot;select ; set-meta meta.txt&quot;</code> to <code>&quot;select 5; set-meta meta.txt&quot;</code>.</p>
  <p>The <code>meta.txt</code> file format is a space(s) delimeted &quot;key&quot; &quot;value&quot; pairs, each on a new line.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-08-02T15:52:52.153Z
Answers.LastActivityDate: 2021-08-02T15:52:52.153Z
Answers.UserDisplayName: truf
Body: <p>How can I add metadata to a DjVu file?</p>
  <p><strong>Desired result:</strong></p>
  <pre><code>$ exiftool sample.djvu | grep -P &quot;^===|Title|Author&quot;
  Title                           : Group Theory and Physics
  Author                          : Shlomo Sternberg
  </code></pre>
  <p>It sounds like XMP metadata would do the trick:</p>
  <pre><code>$ djvused sample.djvu -e 'set-xmp sample.xmp'
  </code></pre>
  <p>Though I'm unsure how to create the XMP file itself -- and examples on the internet are sparse.</p>
  
Tags: <metadata><djvu>
Title: Adding metadata to DjVu
UserDisplayName: Mateen Ulhaq
ThreadText: # Adding metadata to DjVu
  
  (Asked by: username_0 on 2020-10-30)
  
  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.
  
  **Tags:** metadata, djvu
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2021-08-02. Score: 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.
  
  
  ---
  
  