5

I put the following example code to the file called bookmarks.txt:

(bookmarks
 ("1 first chapter" "#10" 
 ("1.1 first section" "#11" 
 ("1.1.1 first subsection" "#12" ))
 ("1.2 second section" "#13" ))
 ("2 second chapter" "#14" 
 ("2.1 first section" "#16" )
 ("2.2 second section" "#13" ))
)

run the following command:

djvused testfile -e 'set-outline bookmarks.txt' -s

nothing happens to my testfile.djvu file. No bookmarks are embedded to it.

What do I do wrong?

Many thanks!

Ahu Lee
  • 295

2 Answers2

2

You need to put the filename last:

djvused -e 'set-outline bookmarks.txt' -s testfile.djvu

From the manpage:

djvused [options] djvufile
Geremia
  • 573
1

Even though this post is quite old, I believe it is convenient to put what I do following the information of the man page of djvused (or here):

1) Create a .dsed file

$ djvused testfile.djvu -e 'output-all' > testfile.dsed 

If the .djvu is just a bunch of images (as it is the case of all of my files), the .dsed file is a text file with just one line:

select; remove-ant; remove-txt;

2) Given that a file bookmarks.txt with the relevant bookmarks has been created beforehand, then we must edit the .dsed file so it contains the line:

select; remove-ant; remove-txt; set-outline 'bookmarks.txt'

3) Because testfile.djvu will be changed, I would make a backup copy (just in case). And finally, we can recreate the text and annotations

$ djvused testfile.djvu -f testfile.dsed -s

And testfile.djvu now contains a table of contents (tested wit Okular).

I hope someone finds this useful. It has worked for me.