edit djvu without remaking the whole file

Don't know where to start, or stuck on a certain problem? Drop by and tell us about it. Feel like helping others? Start here.

Moderator: peterZ

Post Reply
0kelvin
Posts: 29
Joined: 10 Nov 2012, 17:14
Number of books owned: 0
Country: Brazil

edit djvu without remaking the whole file

Post by 0kelvin »

Is it possible to remove, add or replace pages in djvu without extracting and recompressing all pages?
duerig
Posts: 388
Joined: 01 Jun 2014, 17:04
Number of books owned: 1000
Country: United States of America

Re: edit djvu without remaking the whole file

Post by duerig »

I don't know of a way to do this. I suspect that this may not be possible. Partly because I know that one of the ways in which DJVU files save space is by compressing across pages instead of treating each page individually.

-D
mhr
Posts: 37
Joined: 07 May 2012, 10:12
E-book readers owned: onyx-boox-m92 sony-trs-t1
Number of books owned: 500
Country: Germany

Re: edit djvu without remaking the whole file

Post by mhr »

Actually it is possible, though the compression will usually suffer.
The software I use consist of the command line tools from "djvutools".
On Debian Linux the package is called "djvulibre-bin".
These tools exist in all operation systems as far as I know.

The toolchain consist of expanding a collection of DJVU pages within a DJVU file into
a directory. There are files ending with ".djvu" with page descriptions. These are linked
to files with ending ".iff" containing common character encodings. This link is done by a
textual field with the file name of the ".iff" file within the ".djvu" file.

If individual ".djvu" pages are deleted, the ".iff" files may be to large due to now obsolete character encodings.
This will reduce compression ratio.

If other pages are added, they will usually have their own ".iff" file. There might be redundant character information
which also lead to reduced compression ratio.

Finally if all old pages are deleted and new pages are added, they can be combined again to a single ".djvu" file
containing all ".djvu" pages and ".iff" character encodings.
Post Reply