Read/Write DjVu multipage documents.
Read/Write DjVu multipage documents.The "new" DjVu multipage documents can be of two types: bundled and indirect. In the first case all pages are packed into one file, which is very like an archive internally. In the second case every page is stored in a separate file. Plus there can be other components, included into one or more pages, which also go into separate files. In addition to pages and components, in the case of the indirect format there is one more top-level file with the document directory (see DjVmDir), which is basically an index file containing the list of all files composing the document.
This class can read documents of both formats and can save them under any format. It is therefore ideal for converting between bundled and indirect formats. It cannot be used however for reading obsolete formats. The best way to convert obsolete formats consists in reading them with class DjVuDocument class and saving them using write or expand.
This class can also be used to create and modify multipage documents at the low level without decoding every page or component (See insert_file() and delete_file()).
Note: For bundled documents the file is not
read into memory. We just open it and access data directly there.
Thus you should not modify the file contents.
void insert_file(const GP<DjVmDir::File> & f, GP<DataPool> data, int pos=-1)
void delete_file(const char * id)
GP<DjVmDir> get_djvm_dir(void)
GP<DataPool> get_data(const char * id)
Reading routines
void read(ByteStream & str)
void read(const GP<DataPool> & data_pool)
void read(const char * name)
Writing routines
void write(ByteStream & str)
void write_index(ByteStream & str)
void expand(const char * dir_name, const char * idx_name)
idx_name - Name of the top-level file with the DjVmDir
with the list of files composing the given document.
If empty, the file will not be created. DjVmDoc(void)
Alphabetic index HTML hierarchy of classes or Java