Tag Info

Hot answers tagged

3

I tried printing the djvu file to PDF (using Evince, so it's probably a mix of djvulibre, gtk+ and cairo), but I got a way smaller result by converting the djvu pages to pdf using ImageMagick's convert. For this, you need to extract each page as a separate djvu document (I'm not sure if convert is able to deal multipage djvu and multipage pdf that ...


2

Quoting http://djvu.sourceforge.net/doc/man/djvused.html Strings denote an arbitrary sequence of bytes, usually interpreted as a sequence of UTF-8 encoded characters. Strings in djvused files are similar to strings in the C language. They are surrounded by double quote characters. Certain sequences of characters starting with a backslash ("\") have a ...


2

Here's an awk script that attempts to produce decent indentation. It assumes the input is well-formed (e.g. the line before 3.2.2 must be 3.1 or 3.1.something, not 3). #! /usr/bin/awk -f BEGIN { printf "(bookmarks"; depth = 1; } { level = split($1, s, "."); while (level < depth) {--depth; printf ")";} print ""; depth = level + 1; ...


1

There aren't so many tools that can operate directly on DjVu files, compared with other more common formats such as PDF or JPEG. With image manipulation programs, there's the added hurdle that most of these operate on a single image at a time, but the DjVu file contains multiple pages. One possibility is to go via pdf. With ddjvu from DjVuLibre, a PDF un2up ...


1

The following is untested, but in principle it should work (I will test it if I have more time). You could convert the djvu file for example to jpg's like this: #!/bin/sh # djvu -> jpgs converter i=1 # number of pages (392) while [ $i -ne 392 ] do ddjvu -page=$i -format=pnm 1.djvu $i.pnm pnmtojpeg $i.pnm > $i.jpg rm -f $i.pnm echo "page $i done" ...


1

I didn't see any way to explicitly save a range of pages, so I opted to delete the rest. # Extract and save each page in its own file pages=$(djvused -e 'n' "$if") for ((i=1; i<=$pages; i++)) ;do of="${if%.*}.$(printf "%03d" $i).djvu" djvused -e "select $i; save-page-with \"$of\"" "$if" done # Remove one page from an existing djvu file djvm ...


1

Similar to the .pdf example, the following script will print the first line of text found on a given page (via head -n 1). You can see the available commands by typing djvused --help in the terminal. djvused is in the package djvulibre-bin if="$HOME/Downloads/The Geometry of Exponential Families.djvu" pages=$(djvused -e 'n' "$if") for ((i=1; ...


1

Any programming language will be able to parse your input example correctly. Choose a programming language and then parse the input deliminating the input first by "." and " " at first and " " second. I would use Perl, but whatever language the developer is most familiar with would work fine. Keep in mind that automatic solutions will only work if the ...



Only top voted, non community-wiki answers of a minimum length are eligible