How to embed bookmarks to DjVu file using Djvused (DjVuLibre)?

4

2

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

Posted 2017-01-22T10:15:18.400

Reputation: 123

Answers

1

You need to put the filename last:

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

From the manpage:

djvused [options] djvufile

Geremia

Posted 2017-01-22T10:15:18.400

Reputation: 318

I tried your string with the filename being last. It did't work either. – Ahu Lee – 2017-06-24T09:48:11.537

@AhuLee I'm using DjVuLibre-3.5.27. What are you using? – Geremia – 2017-06-26T23:37:59.430

DjVuLibre-3.5.27, the same. It comes together with DjView 4.10.4. The actual program that should do the embedding is the file called djvused.exe, it's located in the same DjVuLibre folder. For convenience I'm using a batch file with the above command. The batch file is located in the same DjVuLibre folder. – Ahu Lee – 2017-06-27T03:57:10.683

0

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.

GiovanniES

Posted 2017-01-22T10:15:18.400

Reputation: 1