![]() Registered Member ![]()
|
Hi guys,
I have a very simple question. I am looking for a way to search a word in a set of PDFs without open them. I find out that the tool "Find Files/Folders" of Dolphin (Kfind) in the tab "Contents" seems to allow to search for a text in PDFs, but according to this: http://docs.kde.org/development/en/kdeb ... range.html this does not work ... Now I am trying to write a simple application to perform this task. I think that this functionality would be very useful, at least for me. My first idea was to use the "pdftotext" command from the "xpdf-utils" debian package and than use grep. But I think that this is very inefficient... Does anyone know a smarter way to do this? I was also wondering if there is some sort of explanation or documentation of how Okular searches for words in a PDF. I checked out the Okular source code trying to get some ideas, but this kind of reverse engineering is far beyond my possibilities. Thank you in Advance |
![]() Registered Member ![]()
|
Okular uses the Poppler library for PDFs.
I haven't used it myself, but you may find something in the documentation.
Get problems solved faster - get reply notifications through Jabber!
|
![]() Registered Member ![]()
|
|
![]() Registered Member ![]()
|
I actually decided to make it myself for the fun of it...
![]() Here you go:
Get problems solved faster - get reply notifications through Jabber!
|
![]() Registered Member ![]()
|
Works fine.
Nice job Alec ! But you stole my fun of it ![]() |
![]() Registered Member ![]()
|
Can somebody give me a hint on how to compile this sweet little program?
I installed libpoppler-qt4-dev, put the code into main.cpp, called the following: $ qmake -project $ qmake $ make but it's not that easy, "undefined reference to `Poppler::Document::load.." |
![]() Registered Member ![]()
|
Hi evod,
add this line to your *.pro file: LIBS += -lpoppler-qt4 I had a similar issue and this fixed the problem. It is simply a missing library. Hope this helps. Bye |
![]() Registered Member ![]()
|
Thank you Alec and Hari!
I adapted the code to search a complete directory for pdfs. That's quite helpful for writing a dimploma thesis with all that literature lying around ![]()
|
![]() Registered Member ![]()
|
Registered users: Bing [Bot], Google [Bot], Sogou [Bot]