After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 303415 - Text search for djvu
Text search for djvu
Status: RESOLVED FIXED
Product: evince
Classification: Core
Component: general
0.3.x
Other Linux
: Low enhancement
: ---
Assigned To: Evince Maintainers
Evince Maintainers
Depends on:
Blocks:
 
 
Reported: 2005-05-07 21:51 UTC by MT
Modified: 2006-02-19 20:30 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Adds search and copy support for djvu (34.28 KB, patch)
2006-02-19 16:55 UTC, Michael Hofmann
committed Details | Review

Description MT 2005-05-07 21:51:54 UTC
DjVu documents can have textual data stored with each page along with the page
image. Evince should be able to search the text of a djvu document, as with PDFs.
Comment 1 Nickolay V. Shmyrev 2005-05-07 22:02:32 UTC
Right, but the current djvulibre public API doesn't allow such advanced 
operations. So probably this won't be done in near future.
Comment 2 MT 2005-05-07 22:21:29 UTC
But don't the Qt-based djview and the command-line apps djvused and djvutxt do
that? I thought they also utilize the same djvulibre API.
Comment 3 Nickolay V. Shmyrev 2005-05-07 22:24:23 UTC
They use private parts of api, while public installed part is much less 
usable. Probably, we should also try to have copy-pasted headers or ask 
djvulibre developers for more functions.
Comment 4 Michael Hofmann 2006-02-19 16:55:50 UTC
Created attachment 59715 [details] [review]
Adds search and copy support for djvu

This patch adds search and text copy support for djvu files. It requires a current libdjvu (configure.ac).

Because I didn't really understand the interface for text selection, there is no support yet for showing the marked text, but it still works. Just select an imaginary rectangle and all text that is in the given range is selected and copied (works like the pdf selection). Any hints on how to implement this interface would be appreciated :-).

Outline support could also be implemented with the new library version, but I don't have any djvu-files with that.

Example for testing: http://craphound.com/down/Cory_Doctorow_-_Down_and_Out_in_the_Magic_Kingdom.djvu
Comment 5 Nickolay V. Shmyrev 2006-02-19 20:28:20 UTC
Wonderful, thanks a lot Michael

I've committed a patch, although few minor issues are left, but I think we will fix them later. Probably separate bugs about them should be created:

1. I prefer more gobject-oriented code (probably it's possible to make DjvuPageText a successor of GObject) and so on.

2. There is minor offset in highlighting. I don't know if it's OCR bug or our bug, but we have similar problem in PDF, so probably it's rendering bug.

3. There is problem in miniexp header described in http://sourceforge.net/tracker/index.php?func=detail&aid=1434756&group_id=32953&atid=406583
i wanna see it fixed but it's Leon's task.

Comment 6 Nickolay V. Shmyrev 2006-02-19 20:29:59 UTC
And, about selection, yeah, current interface is a bit poppler-oriented, it will be hard to implement text rendering with djvu. Probably we should rethink this interface, let's also discuss it in another bug.