PdfViewer (app + library)
Qt Stuff
Score 68%
Description:

This is a simple program for viewing PDF files. There is also a library providing a PdfView widget which can be easily embedded in other programs.

The reason for writing this program is to have a lightweight Qt-only PDF viewer with the features that I want. As my time is limited, I probably won't have time to implement any feature requests for this program. Of course you should still post the requests, but they will likely end up in the TODO list. If you want to see additional features, sending patches will dramatically increase the chances of seeing the features implemented. Any developers are welcome to join this project.

Features:
[li]"continuous" view mode (other view modes do not exist yet)[/li]
[li]magnifying glass when clicking with the left mouse button on the page[/li]
[li]reload PDF file when it is changed on disk by another program[/li]
[li]links in "Table of Contents" are clickable[/li]
[li]links in PDF file are clickable[/li]
[li]search string in document[/li]
[li]interface without menu bar (interface with menu bar can be obtained by changing the option in the configuration dialog and then restarting the program)[/li]
[li]presentation mode[/li]
[li]it is possible to modify the style of the buttons in the tool bar by clicking with the right mouse button on the toolbar[/li]
[li]shortcut editing dialog[/li]
[li]bookmarks mechanism[/li]
[li]remember page positions and zoom factor per file throughout sessions[/li]
[li]select image or text in a rectangular area[/li]
[li]text selection[/li]
[li]support for forward search and inverse search using synctex (it is also possible to compile this app+lib without synctex support)[/li]
[li]printing[/li]
[li]support for PDF forms[/li]

Note that the user interface can be completely controlled using the keyboard (except for the magnifying glass, selection and links). When no menu bar is shown, the items in the tool bar can be triggered using Alt + their accelerator. The "Open File" dialog can be accessed using the standard "Open" shortcut (in an English system this is usually "Ctrl+O").
Last changelog:

5 years ago

version 0.7
- add support for PDF forms
- move mouse tool changing actions to the library
- make sure the library is installed in /usr/lib64 when appropriate
- add option to print multiple pages on one page

C

glad

5 years ago

Forgot to say that in the editor you should use the following command: pdfviewer "file:$$o#src:$$n $$t" (i.e. the same as for Okular but without the "--unique" flag).

Report

lionhater

5 years ago

Thank you sir.

Report

lionhater

5 years ago

I wish I could help in patching, but I'm only a noob.

As for the Razor-Qt, they're presumably building a Qt-only DE and list possible apps in their wiki to be used in it, though not to be bundled with it. I'm sure they will add your app as well. If not I'll inform them!

Thanks again for the fine app.

Report

C

glad

5 years ago

Ah, I see. OK, thanks for informing them.

Report

lionhater

5 years ago

The discussion in the Razor mailing list:

http://groups.google.com/group/razor-qt/browse_thread/thread/1527cae9af875f87/f0dbd22e36eeaa70?show_docid=f0dbd22e36eeaa70

Report

flywheeldk

5 years ago

In short - it would be very much appreciated if you create a public repo (Git/Mercurial, whatever), instead of just publishing the code through here.

BTW : I think the PDF Viewer is rather cool - enjoy using it.

Report

lionhater

5 years ago

Thanks for the gift, but I can't "make" it in Mageia LXDE:

../src/label.cpp:99:91: error: invalid conversion from ‘const Poppler::LinkGoto*’ to ‘Poppler::LinkGoto*’ [-fpermissive]
../src/label.cpp:107:97: error: invalid conversion from ‘const Poppler::LinkBrowse*’ to ‘Poppler::LinkBrowse*’ [-fpermissive]
../src/label.cpp:113:97: error: invalid conversion from ‘const Poppler::LinkAction*’ to ‘Poppler::LinkAction*’ [-fpermissive]
make: *** [obj/label.o] Error 1

Report

C

glad

5 years ago

This bug has been solved in version 0.3.1.

Report

lionhater

5 years ago

Thank you. Just a couple of days ago I've searched hard to find a good PDF viewer for LXDE (and LyX). This is better then epdfviewer. The ability to select text would make it perfect for most use cases I guess. A fine app for Razor-Qt project as well.

Report

C

glad

5 years ago

Yes, text selection is one of my plans. However, the problem is that currently Poppler only supports obtaining the text in a rectangular selection (of course I want to implement this too), so obtaining a text-based selection (similar like in a text-editor or in a browser) will be hard to implement. If the text is in two-column format, it will be even harder to implement (I don't know how to detect a two-column format). Patches would make me incredibly happy ;-)

As far as I understood, the goal of the Razor-Qt project is to provide only a desktop shell (for example KDE Plasma, Gnome Shell and Unity are desktop shells, in the old days we called that a desktop environment but it seems that people now understand the latter notion as something as huge as the KDE Software Compilation or Gnome), so including this in Razor-Qt makes little sense. Of course, if there exists some Qt based desktop environment that has the same goals like KDE or Gnome, it would be very nice to include this program in it.

Report

C

glad

5 years ago

Text selection is implemented in version 0.4. This was easier than I expected because of the awesomeness of Poppler.

Report

lionhater

5 years ago

Thanks again.

Report

mantur

5 years ago

Nice work but I have several compiler errors like this:

1>.\src\embeddedfilesdock.cpp(21) : fatal error C1083: Cannot open include file: 'poppler-qt4.h': No such file or directory

Is this a library?
I'm try to build it with VS2008 on seven.
Thank you in advance for your help.

Report

C

glad

5 years ago

You have to compile the Poppler library first. Note that the Poppler devs are kind enough to not provide any binaries for Windows (sarcasm), so you have to do one of the following things:
- get the poppler dlls and headers (and the dlls of its dependencies) from somewhere. For example, you can install ktikz for windows from http://www.hackenberger.at/blog/ktikz-editor-for-the-tikz-language/ and get the dlls from there, note that the latter are compiled using MinGW (the ktikz source code contains an INSTALL.Windows text file giving the complete explanation on which dlls and which .h files you need).
- compile Poppler yourself. Instructions can be found at http://laconsigna.wordpress.com/2011/07/14/compiling-poppler-on-windows/. Good luck with that.
When you have the poppler library, then some modifications must be made to the qmake .pro files. When I have time, I will do that myself, otherwise you should have a look at the code for ktikz and try to transpose that to pdfviewer (hint: search for win32 in the .pro and .pri files). Good luck with that too.

If you manage to succeed in all the above (especially if you succeed in compiling poppler yourself), you will fully understand why opensource programmers hate developing for Windows. If miraculously you find the above easy to do, then please be so kind to tell me what on earth you did exactly, I will be so thankful to you.

Report

mantur

5 years ago

Thank you for your help, I can only agree with you , the possibility of failure are too high ... At least for my level of knowledge.

Report

C

glad

5 years ago

I added in version 0.7.3 some untested qmake code to compile PdfViewer on Windows. If you install KtikZ for Windows (see link above) and grab the following dlls from the installed directory:
iconv.dll
jpeg62.dll
libfontconfig.dll
libfreetype.dll
liblcms-1.dll
libopenjpeg.dll
libpng12.dll
libpoppler.dll
libpoppler-qt4.dll
libxml2.dll
zlib1.dll
and if you grab the following header files from the poppler source code (the tar-ball can be found at http://poppler.freedesktop.org/):
poppler-annotation.h
poppler-export.h
poppler-link.h
poppler-optcontent.h
poppler-page-transition.h
poppler-qt4.h
and install all these files (both the dlls and the header files) in the win32 directory, then I think that you will be able to compile PdfViewer on Windows (using qmake, not cmake).

Report

mantur

5 years ago

Thank you very much for your help! Now the compilation is fine, but of course there is a linker problem.

1>embeddedfilesdock.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class QByteArray __thiscall Poppler::EmbeddedFile::checksum(void)const " (__imp_?checksum@EmbeddedFile@Poppler@@QBE?AVQByteArray@@XZ) referenced in function "protected: virtual void __thiscall EmbeddedFilesDock::fillInfo(void)" (?fillInfo@EmbeddedFilesDock@@MAEXXZ)
1>embeddedfilesdock.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class QDateTime __thiscall Poppler::EmbeddedFile::modDate(void)const " (__imp_?modDate@EmbeddedFile@Poppler@@QBE?AVQDateTime@@XZ) referenced in function "protected: virtual void __thiscall EmbeddedFilesDock::fillInfo(void)" (?fillInfo@EmbeddedFilesDock@@MAEXXZ)
1>embeddedfilesdock.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class QDateTime __thiscall Poppler::EmbeddedFile::createDate(void)const " (__imp_?createDate@EmbeddedFile@Poppler@@QBE?AVQDateTime@@XZ) referenced in function "protected: virtual void __thiscall EmbeddedFilesDock::fillInfo(void)" (?fillInfo@EmbeddedFilesDock@@MAEXXZ)
1>embeddedfilesdock.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: int __thiscall Poppler::EmbeddedFile::size(void)const " (__imp_?size@EmbeddedFile@Poppler@@QBEHXZ) referenced in function "protected: virtual void __thiscall EmbeddedFilesDock::fillInfo(void)" (?fillInfo@EmbeddedFilesDock@@MAEXXZ)
1>embeddedfilesdock.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class QString __thiscall Poppler::EmbeddedFile::description(void)const " (__imp_?description@EmbeddedFile@Poppler@@QBE?AVQString@@XZ) referenced in function "protected: virtual void __thiscall EmbeddedFilesDock::fillInfo(void)" (?fillInfo@EmbeddedFilesDock@@MAEXXZ)
1>embeddedfilesdock.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class QString __thiscall Poppler::EmbeddedFile::name(void)const " (__imp_?name@EmbeddedFile@Poppler@@QBE?AVQString@@XZ) referenced in function "protected: virtual void __thiscall EmbeddedFilesDock::fillInfo(void)" (?fillInfo@EmbeddedFilesDock@@MAEXXZ)
1>embeddedfilesdock.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class QList<class Poppler::EmbeddedFile *> __thiscall Poppler::Document::embeddedFiles(void)const " (__imp_?embeddedFiles@Document@Poppler@@QBE?AV?$QList@PAVEmbeddedFile@Poppler@@@@XZ) referenced in function "protected: virtual void __thiscall EmbeddedFilesDock::fillInfo(void)" (?fillInfo@EmbeddedFilesDock@@MAEXXZ)
1>embeddedfilesdock.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: bool __thiscall Poppler::Document::hasEmbeddedFiles(void)const " (__imp_?hasEmbeddedFiles@Document@Poppler@@QBE_NXZ) referenced in function "protected: virtual void __thiscall EmbeddedFilesDock::fillInfo(void)" (?fillInfo@EmbeddedFilesDock@@MAEXXZ)
1>embeddedfilesdock.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: enum Poppler::Document::PageMode __thiscall Poppler::Document::pageMode(void)const " (__imp_?pageMode@Document@Poppler@@QBE?AW4PageMode@12@XZ) referenced in function "public: virtual void __thiscall EmbeddedFilesDock::documentLoaded(void)" (?documentLoaded@EmbeddedFilesDock@@UAEXXZ)
1>optcontentdock.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: enum Poppler::Document::PageMode __thiscall Poppler::Document::pageMode(void)const " (__imp_?pageMode@Document@Poppler@@QBE?AW4PageMode@12@XZ)
1>fontsdock.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class QString __thiscall Poppler::FontInfo::file(void)const " (__imp_?file@FontInfo@Poppler@@QBE?AVQString@@XZ) referenced in function "protected: virtual void __thiscall FontsDock::fillInfo(void)" (?fillInfo@FontsDock@@MAEXXZ)
....

I do not wanna waste much time, but you have an idea where I can find these libraries?
Thank you in advance ...

Report

C

glad

5 years ago

It seems that the Qt libs cannot be found, which is strange. I assume that Qt is installed correctly on your machine, so qmake should be able to find those libraries. The needed dlls are: QtCore4.dll, QtGui4.dll, QtXml4.dll, mingwm10.dll, libgcc_s_dw2-1.dll (the last two could have a slightly different name or be different files altogether). Normally these dlls should be found automatically by qmake in the Qt installation and this should require no interaction of the person compiling this program.

I will have a look at it the next time I boot into Windows (that can take some time because I do not boot often in Windows, sorry).

Report

C

glad

5 years ago

I managed yesterday evening to force myself to boot Windows again ;-) The above error is my fault. I corrected the qmake files, so now it should work.

Report

TSDgeos

5 years ago

Oh the irony of you complaining poppler does not provide a compiled version for Windows when you don't provide a compiled version for Windows either :D

Report

mantur

5 years ago

Your irony is too high for my english knowledge.
In altre parole ma che stai a dí?

Report

C

glad

5 years ago

The irony is the same as in the case that an inhabitant of a remote village is complaining that he cannot introduce electricity in his home because there is no electricity in his street and the government tells him "Oh the irony of complaining the government doesn't put electricity in your street when you don't build the cables yourself from the power plant to your home". He furthermore seems to be unaware that the ktikz binary for Windows is provided by me, that's how I know it is hard.

Report

mantur

5 years ago

Maybe I'm part of another planet. Sorry for the trouble.

Report

C

glad

5 years ago

Then I am on the same planet as you because I don't understand the irony either. I gave the example with the electricity to make the absurdity of that argument more obvious.

Report

C

glad

5 years ago

I forgot to say that he is the maintainer of Poppler. Maybe this knowledge will make the discussion more clear to you.

Report

5 years ago

version 0.7
- add support for PDF forms
- move mouse tool changing actions to the library
- make sure the library is installed in /usr/lib64 when appropriate
- add option to print multiple pages on one page

File (click to download) Version Description Filetype Packagetype License Downloads Date Filesize OCS-Install DL
Details
version
0.7
updated Sep 30 2012
added Mar 20 2012
downloads today
0
page views today 1