4

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!

1

You need to put the filename last:

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

From the manpage:

djvused [options] djvufile
  • I tried your string with the filename being last. It did't work either. – Ahu Lee Jun 24 '17 at 9:48
  • @AhuLee I'm using DjVuLibre-3.5.27. What are you using? – Geremia Jun 26 '17 at 23:37
  • 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 Jun 27 '17 at 3:57
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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.