<p>
To embed text into a Djvu file, you must create a <code>djvused</code> script detailing the page and bitmap location of one of: character, word, line, paragraph, or region.
</p>

<p>
For good measure, you should first list the contents of your Djvu bundle:
</p>

<pre><code>$ djvused -e 'select; ls' test.djvu
   1 P   177062  p0001.djvu
   2 P   199144  p0002.djvu
   3 P    12323  p0003.djvu
   4 P    57059  p0004.djvu
   5 P    96725  p0005.djvu
   6 P    53868  p0006.djvu
</code></pre>

<p>
Then define the location of text in a file called, for instance, <code>content.dsed</code>. Assume that my page is 1000 px by 1000 px&#58;
</p>

<pre><code>select; remove-ant; remove-txt

select "p0004.djvu" # page 4
set-txt
(page 0 0 1000 1000
 (word 100 600 450 800 "Hello" )
 (word 100 600 450 800 "world" ))

.

select "p0005.djvu"
set-txt
(page 0 0 1000 1000
 (line 100 400 900 600 "Hacker Puppy Radio"))
</code></pre>

<p>
Apply this script to your Djvu file with <code>dvjused</code>&#58;
</p>

<pre><code>djvused -f ./content.dsed -s test.djvu
</code></pre>

<h2>Converting from PDF to Djvu</h2>

<p>
You can convert PDF files to Djvu with the <code>djvudigital</code> command. Due to license incompatibility, it does require you to compile a Ghostscript plugin, but it's an easy build. Get the <a href="https://sourceforge.net/projects/djvu/files/GSDjVu/1.10" target="_blank">gsdjvu</a> code, and then follow its README instructions.
</p>

<p>
Once you've built the Ghostscript driver, you can convert PDF to Djvu:
</p>

<pre><code>djvudigital --words foo.pdf foo.djvu
</code></pre>
