PDA

View Full Version : reading pdf file



kito
21st June 2012, 13:08
how can I read from pdf file in Qt?

wysota
21st June 2012, 13:17
http://poppler.freedesktop.org/

sonulohani
21st June 2012, 14:45
but it is only for linux. could you please tell me about how to use it in windows????

wysota
21st June 2012, 15:19
How do you know it is only for Linux?

kito
21st June 2012, 17:45
I managed to get it but now I have another problem "error while loading shared library libpoppler.so.4" I get this error while building the project but I have included this line "LIBS += -L/usr/local/lib =lpoppler " in my project.I am using Ubuntu

sorry I included line "LIBS += -L/usr/local/lib -lpoppler-qt4" in my project

Added after 6 minutes:

there are libpoppler.so and libpopper.so.4 in the library path

wysota
21st June 2012, 21:35
Run ldd on libpoppler.so and see if you have all the dependencies fulfilled.

kito
22nd June 2012, 15:32
it is working after coping libpoppler.so into /usr/lib but now i dont know if it is going to solve my problem.The document can be loaded and I am able to find many things such as finding the number of pages.However my real problem was to read the contents of pdf file into say list.

wysota
22nd June 2012, 18:54
If you expect to receive full structure of the document with images and stuff then poppler won't help. I doubt any PDF library will since the file format itself does not hold any structure of the data it contains. If you just want text without any formatting then poppler should handle that without problems (there is access to pages and lists of text).

kito
23rd June 2012, 09:17
Thanks Wysota I wanted text from the pdf file.Now everything is working fine.Thanks again