tools.djvu — DJVU files wrapper#

Wrapper around djvulibre to access djvu files properties and content.

class tools.djvu.DjVuFile(file)[source]#

Bases: object

Wrapper around djvulibre to access djvu files properties and content.

Perform file existence checks.

Control characters in djvu text-layer are converted for convenience (see http://djvu.sourceforge.net/doc/man/djvused.html for control chars details).

Parameters:

file (str) – filename (including path) to djvu file

static check_cache(fn)[source]#

Decorator to check if cache shall be cleared.

static check_page_number(fn)[source]#

Decorator to check if page number is valid.

:raises ValueError

delete_page(*args, **kwargs)[source]#
get_most_common_info()[source]#

Return most common size and dpi for pages in djvu file.

get_page(*args, **kwargs)[source]#
has_text(*args, **kwargs)[source]#
number_of_images(*args, **kwargs)[source]#
page_info(*args, **kwargs)[source]#
whiten_page(*args, **kwargs)[source]#