Daniel Reetz, the founder of the DIY Book Scanner community, has recently started making videos of prototyping and shop tips. If you are tinkering with a book scanner (or any other project) in your home shop, these tips will come in handy. https://www.youtube.com/channel/UCn0gq8 ... g_8K1nfInQ

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.
Post Reply
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 » 26 Aug 2015, 10:53

Is it possible to remove, add or replace pages in djvu without extracting and recompressing all pages?

Posts: 377
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 » 26 Aug 2015, 13:29

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.


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 » 21 Sep 2015, 04:21

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