Skip to content

Draft: Show DjVu search results in sidebar

Jason Crain requested to merge jcrain/evince:djvu-search into main

DjVu search results currently do not show in the sidebar because the DjVu backend doesn't implement the EvDocumentTextInterface get_text_layout function. However, this function requires that each character has a distinct position on the page so that the position can later be used to find the character it refers to. This is not suitable for DjVu documents because they may not specify each character's position, but only location of words, lines, or paragraphs, making the mapping from position to character impossible.

This defines a new find_text_offset interface function which, in addition to the bounding boxes of the found texts, also returns the start and end offsets of the text, making the position-to-character lookup unnecessary. The find job, view, and sidebar are updated to use this new function and data structure.

Fixes #751

Edited by Germán Poo-Caamaño

Merge request reports