How to open a *.pdf in an already existing instance of Okular (independent of in which workspace that instance resides)?

7,652

I recently wanted to have the same functionality. Here is the simplest solution I could find:

Open Okular GUI. Navigate to Settings > Configure Okular. In General, under Program Features, check the 'Open new files in tabs' option. Click Apply. Click OK.

Then on your terminal, run okular file1.pdf file2.pdf fileN.pdf.

That code should open all your files in the same Okular window in different tabs. This method works across folders.

Share:
7,652

Related videos on Youtube

nutty about natty
Author by

nutty about natty

Updated on September 18, 2022

Comments

  • nutty about natty
    nutty about natty almost 2 years

    acroread and qpdfview already perform as desired: if an instance of acroread or qpdfview, resp., is already running this instance will open any pdf files, irrespective of the workspace from which these files are "launched".

    Now here's the catch: okular, alas, behaves differently:

    "launching" (read: opening) a pdf file from a given workspace will create a new instance of okular in that workspace, unless that particular workspace already has an instance of okular up and running.

    Anything I can add to /usr/bin/okular to do the trick?

    man okular doesn't give any hints to this and also from within okular I see no indicative option in the native settings.

    • Admin
      Admin about 10 years
    • Admin
      Admin about 10 years
      This answer may work to distinguish between multiple displays but not workspaces...
    • Admin
      Admin about 10 years
      I tested it, and I get the same behaviour. With Settings > Configure Okular… > General > Program Features > Open new files in tabs, I open pdfs in the same instance, unless opening from a different virtual desktop (with Dolphin). However, it works when initiating from a different activity. This sounds like a bug to me.
    • Admin
      Admin about 10 years
      acroread has the -openInNewInstance option, qpdfview the --unique option, see the respective man pages and *.desktop files. okular OTOH seems to offer nothing along those lines... (? so either need to go deep into okular code, recompile, etc or apply some other trick (unity, compiz, ...) ?)
    • Admin
      Admin about 10 years
      Okular has a global option in its settings though. Like I said, I think it's a bug, since it works fine for pdfs opened in the same virtual desktop.
    • Admin
      Admin over 4 years
      I'm experiencing the same thing. Hope this gets fixed.
  • nutty about natty
    nutty about natty almost 8 years
    My question was workspace-related. Your answer and my question don't overlap.
  • terdon
    terdon almost 8 years
    @nuttyaboutnatty then please edit your question to make that clear. It does sound like you're trying to open in tabs. You might want to emphasize that your issue is when you're opening something from the file manager and not from okular and that it is about workspaces.
  • nutty about natty
    nutty about natty almost 8 years
    @terdon Disagree. See title, tag and content.
  • terdon
    terdon almost 8 years
    @nuttyaboutnatty if at least two people have had trouble understanding your question, that's a pretty good indication that it isn't quite as clear as you think it is. Change it or not, it's completely up to you, but you're more likely to get a helpful answer if you do.
  • nutty about natty
    nutty about natty almost 8 years
    @terdon edited.