bell notificationshomepageloginedit profileclubsdmBox

10% popularity   0 Reactions

There is AFAIK not such a utility that does exactly what you want but you can explode the file by repeatedly using the djvused utility:

djvused file.djvu -e "select <nr>; save-page-with <filename>"

where <nr> is the pagenumber and <filename> the output filename. I have a python utility that does this automatically for all the pages while using incremental filename of the form page_<nr>.djvu.

After that you can combine multiple files with the djvm command:

djvm -c output.djvu page01.djvu page02.djvu ... page06.djvu

for each of the combinations of page. The images and associated data (like OCR-ed text) will get in the 84 files. That data is not unpacked and repacked, so the process doesn't lead to any loss of quality.

The following is a minimalistic version of my Python program that calls djvused to explode the file into individual pages:

#! /usr/bin/env python

import sys
from subprocess import check_output

page_base = 'page_{:03d}.djvu'
file_name = sys.argv[1]
djvused = 'djvused' # r'C:Program FilesDjVuLibredjvused.exe'
number_of_pages = int(check_output([djvused, file_name, '-e', 'n']))
for x in range(number_of_pages):
page_name = page_base.format(x)
check_output([djvused, file_name, '-e',
'select {}; save-page-with {}'.format(x+1, page_name)])


Free books android app tbrJar TBR JAR Read Free books online gutenberg


Load Full (0)

Login to follow story

More posts by @Lorraine

0 Comments

Sorted by latest first Latest Oldest Best

 

Back to top