← Back to team overview

qpdfview team mailing list archive

Re: NPAPI plug-in using qpdfview's DocumentView class

 

Hello,


As I am not a programmer :(  (I would like to learn someday), unfortunately
I cannot contribute writing code; however I am trying to do my best as a
tester and making some suggestions.

1) I would like to ask first how to test the qtbrowserplugin ... it is the
first time I heard about this concept, so my knowledge is almost null.
Where should I put the qtbrowserplugin folder? Does it need a different
compilation? It is possible to include it in the tar.gz and the .deb
package of qpdfview (in other words, build the plugin at the same time as
the program?)

2) I have tried to test mozplugger in different browsers and with different
programs (from gv, to evince, to okular, to qpdfview and xpdf) and these
are my conclusions that might improve a pdf plugin:

- First, a great problem in all cases is related to keyboard shortcuts.
Specially change pages is problematic. Of course, in Mozilla things work
better than other browsers; in Opera, keyboard shortcuts don't work.

- Second, a small problem is that in order to open the files, in Evince and
Qpdfview, the way the program look when embedded in the browser depends on
the user settings for the respective programs. However, this shouldn't be
the right way. Why? Because in browsers, usually windows are maximized, so
vertical space is important (and then usually, the default way to view the
PDF is the "Fit to Page" way; on the other hand, horizontal space is
available, so by default, bookmarks, thumbnails and toolbars can be set to
the left, and be visible without problem. And using the settings to save as
much vertical space as possible.

In other words, the right way to configure it could be to set a separate
.conf file for the plugin, different from the .conf file for the default
program (other settings for memory could be set differently also; in other
words, it is highly convenient to separate both).

Look at the following screenshots, showing an idea on how a PDF could look
like using a browser plugin:

Image 1:
http://imageshack.us/photo/my-images/860/201207102250311366x768s.png/

Image 2: http://imageshack.us/photo/my-images/4/201207102251041366x768s.png/

Of course, the ideal would be the first image, but with the toolbars' width
corrected as in image 2. This also shows a problem with qpdfview: The edit
and view toolbars are not correctly set for vertical use.

That's all. Hopefully my comments could be useful as an improvement of the
program and the plugin (as mentioned in the last paragraph, improving a
plugin could actually help to improve how the program and the toolbars
looks).

And I will be grateful for indications on how to use the plugin, or better
if this could be integrated into the development builds like other PDF
programs (which include the plugins in the install package).


Thanks for your attention. Have a good night!



On Mon, Jul 9, 2012 at 12:04 PM, Adam Reichold <adamreichold@xxxxxxxxxxx>wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hello,
>
> I tried out the "qtbrowserplugin" solution and was able to create a
> very simple plug-in that uses qpdfview's DocumentView class to display
> a PDF file embedded in a web page. (It just downloads the complete
> file and saves it as a temporary file. Not very elegant but simple.)
>
> It is also able to receive keyboard events after gaining the focus but
> I just mapped space/backspace to next/previous page and F12 to the
> presentation mode to try this out. (QApplication::setActiveWindow has
> to be forced because of X11Embed problems...)
>
> There is also the problem that the plug-in's QApplication does not
> have organization and application name set, so that the settings are
> not correctly loaded and stored. (Maybe one should just add this in
> the initialization code of "qtbrowserplugin_x11.cpp".)
>
> The code is available on Launchpad at
> "lp:~adamreichold/qpdfview/plugin". One needs a copy of the trunk
> source code and modify "qpdfplugin.pri" to pick that up.
>
> My question would now be whether anybody is interested in picking that
> up since it could be more or less maintained as a separate program and
> my spare time is a bit limited.
>
> Best regards, Adam.
>
>

Follow ups

References