Unsolved PDF open problem
-
@f.lerdino
I really think this could be a root issue, which you have not answered. If I deliberately gosudo xdg-open .....pdf
I get messages like I see in yours:
No protocol specified Unable to init server: Could not connect: Connection refused Cannot parse arguments: Cannot open display: No protocol specified Unable to init server: Could not connect: Connection refused Cannot parse arguments: Cannot open display: Warning: program returned non-zero exit code #1
-
@f.lerdino
I think this is not a Qt issue per se, but an Ubuntu 16.04 one. Try Googling for something likeubuntu 16.04 xdg-open
. I think https://askubuntu.com/questions/779717/xdg-open-stopped-working-since-16-04-upgrade might be where you'll find what you need to do... ? -
@mrjj
I have an old version of ubuntu and everything work. Something is changed after the ubuntu update. Of course I run my QT Program as root. -
@f.lerdino
The link @JonB gives , suggest that
gvfs-info being deprecated.
so that might be your actual issue.
(some posts down) -
@JonB
I use root to run my Qt program -
@f.lerdino
but does it work then if u dont run as root ? -
I use root to run my Qt program
Scary. Which is why I asked earlier.
Given that the error messages you show are complaining as not being able to do stuff as root, I presume when you tested running the
xdg-open
s and said they worked you did so as root too? -
@JonB said in PDF open problem:
Given that the error messages you show are complaining as not being able to do stuff as root, I presume when you tested running the xdg-opens and said they worked you did so as root too?
Yes I have tried as root...
-
Can I run as external program the pdf viewer + mypdffile in QT/Ubuntu?
Thanks
-
@f.lerdino
Well you could run it via QProcess. -
I have the same problem and it seems like the problem is caused by this firefox bug: https://bugzilla.mozilla.org/show_bug.cgi?format=default&id=1323302
(and the resulting change: https://hg.mozilla.org/mozilla-central/rev/90a06cdcb48f)It seems like xdg-open uses firefox in background to display the PDF files.
Unfortunately it seems like the firefox team has not provided a possibility to bypass this behavior.
(Chrome Browser for example provides "--no-sandbox" option to start it as root in a non-root user session)