← Back to team overview

qpdfview team mailing list archive

Re: [Question #695206]: Fullscreen option per script?

 

Question #695206 on qpdfview changed:
https://answers.launchpad.net/qpdfview/+question/695206

    Status: Answered => Open

Alfred Pichler is still having a problem:
Thank you Adam,

for the quick and comprehensive answer.So far I have implemented a mix
of hardware solutions and software control via bash, as I have only
limited programming knowledge. (I'm 75 years old and object-oriented
languages are no longer my strength)

The Python approach fascinated me because of its possibilities.This
makes it possible to solve everything via software.
A RaspberryPi is used. With it I can control everything from the TTL
signal of the button in the GPIO to the end of the show.

I have now tested the Python pattern and a lot works, but I still have
some problems.

Exiting the program:

when trying to install version 0.4.18.99 ~ 2116 ~ 64 ~ ubuntu20.10.1
the following error occurred: and opening with a specific page:
ERROR: Breaks the existing package "qpdfview-djvu-plugin"

and opening with a specific page:

bus = dbus.SessionBus()
proxy = bus.get_object('local.qpdfview', '/MainWindow')
iface = dbus.Interface(proxy, 'local.qpdfview.MainWindow')

#method bool local.qpdfview.MainWindow.open(QString absoluteFilePath,
int page)
file_path ="/home/alfred/v64b1-169-test.pdf"
n = int(3)
iface.open(file_path, n)                  
#ERROR:dbus.connection:Unable to set arguments
('/home/alfred/v64b1-169-test.pdf', 3) according to signature 's':
<class 'TypeError'>: Fewer items found in D-Bus signature than in Python
arguments

Best regards,
Alfred

original:

Vielen Dank Adam,

für die rasche und umfängliche Antwort.
Ich habe bisher einen Mix aus Hardware-Lösungen und Softwaresteuerung
per bash realisiert, da ich nur bescheidene Programmierkenntnisse habe.
(Ich bin 75 Jahre und objektorientierte Sprachen sind nicht mehr meine
Stärke)
Der Ansatz per Python hat mich aber fasziniert von seinen Möglichkeiten her.
Damit ist es möglich alles per Software zu lösen.

Eingesetzt wird ein RaspberryPi. Damit kann ich alles steuern vom
TTL-Signal des Tasters im GPIO bis zum Ablauf der Show.

Ich habe nun das Pythonmuster getestet und vieles geht aber einige
Probleme habe ich noch.

Das Beenden des Programms
beim Versuch die Version 0.4.18.99~2116~64~ubuntu20.10.1 zu
installieren  trat folgender Fehler auf:
ERROR: Breaks the existing package "qpdfview-djvu-plugin"

und das öffnen mit einer bestimmten Seite
#method bool local.qpdfview.MainWindow.open(QString absoluteFilePath,
int page)
file_path ="/home/alfred/v64b1-169-test.pdf"
n = int(3)
iface.open(file_path, n)                   
#ERROR:dbus.connection:Unable to set arguments
('/home/alfred/v64b1-169-test.pdf', 3) according to signature 's':
<class 'TypeError'>: Fewer items found in D-Bus signature than in Python
arguments

Herzlichen Dank und viele Grüße aus München

Alfred Pichler



Am 27.01.21 um 19:05 schrieb Adam Reichold:
> Your question #695206 on qpdfview changed:
> https://answers.launchpad.net/qpdfview/+question/695206
>
>     Status: Open => Answered
>
> Adam Reichold proposed the following answer:
> Hello Alfred,
>
> the intended way for qpdfview to be scripted is via its D-Bus [1]
> interface. Sadly, this is not properly documented but I the names are
> rather self explanatory. You should be able to explore and test this way
> of controlling qpdfview by starting "qpdfview --unique" (this is the
> default when started via a desktop environment) and then running
> qdbusviewer.
>
> If you search for "qpdfview" on the session bus, you should find a
> "local.qpdfview" service which provides "MainWindow/" object that
> implements the "local.qpdfview.MainWindow" interface which includes both
> "fullscreen" and "presentation" methods.
>
> The answers to question [2] include an example of how to automate access
> to this interface via a Python script but the general principle should
> be the same in your preferred scripting/programming language.
>
> As another caveat, while this can be used to trigger the presentation
> view, controlling the presentation view is not yet implemented
> (basically just because nobody asked for it).  There is also currently
> no method to end the application itself (this can be achieved by sending
> SIGTERM via the kill command), but that should be easy to add.
>
> Best regards,
> Adam
>
> [1] https://en.wikipedia.org/wiki/D-Bus
>
> [2] https://answers.launchpad.net/qpdfview/+question/404154
>

-- 
You received this question notification because your team qpdfview is an
answer contact for qpdfview.