60

I want to open a PDF file multiple times with evince. I want to do this to be able to look at different sections of the same file at the same time. Every time I try to open the file again, it only brings up the already opened evince window with my PDF file. I also tried to open a new evince window and then opening my file by using the menu of evince.

Is there any possibility to do this?

David Foerster
  • 35,754
  • 55
  • 92
  • 145
Wauzl
  • 1,723
  • 3
  • 15
  • 21

6 Answers6

81

In evince you can use File --> Open a Copy to open another window showing the same file.

Florian Diesch
  • 86,013
  • 17
  • 224
  • 214
  • 17
    It's a nice feature and all. But first they create a problem, by ignoring multiple invocations, then they give you a menu entry to work around the problem they created. Grr. – Adrian Ratnapala Apr 19 '14 at 07:26
  • This "solution" opens a window where the page is blank no matter what section is selected. – James Bowery Aug 21 '22 at 20:37
  • @JamesBowery If you scroll around or change the view in any way of the blank page, it starts rendering. Definitely a bug, but not anything more than a momentary annoyance. – James Matta Jan 09 '23 at 17:58
9

In Ubuntu 18.04 I found no "View in new window" but did find "Open a copy" under the "File Options" button on the far right. This opens a new instance. Later I found that you won't see the content until you scroll it.

Rob Rutten
  • 657
  • 1
  • 8
  • 16
7

There is no File menu in Ubuntu 18.04's Evince. The other options:

  1. Use Ctrl+N shortcut. It can be found in Keyboard Shortcuts with
    • Keyboard Shortcuts in Alt menu options search
    • Document Viewer -> Keyboard Shortcuts menu
  2. Use menu ☰ -> Open a Copy in the right upper angle, as in Rob's comment.
savfod
  • 171
  • 1
  • 2
4

The accepted answer for this doesn't work for Evince anymore. To view the document multiple times in that program, select "View in new window" from the menu.

William Everett
  • 322
  • 1
  • 12
  • 3
    In Ubuntu 14.04 the menu of Evince is patched to have the old menus. Nevertheless your answer is (probably) correct for everyone who does not use an old or patched version of Evince. Thank you! – Wauzl May 06 '14 at 07:46
  • 1
    It might be worth updating this answer with something specifying in which cases the accepted solution does not work (any other case besides ubuntu 14.04? Perhaps some old evince version?). Otherwise this seems contradictory and confusing. – antosecret Feb 08 '17 at 20:26
2

I don't like Evince's default behavior, so I clear the DBUS_SESSION_BUS_ADDRESS environment variable before invoking it. This is my wrapper script, which I have in a directory that is before /usr/bin in my $PATH:

#!/usr/bin/env bash
set -e

declare -r EX_SOFTWARE=70

# Find the right Evince.
my_id=$(stat -c %d:%i -- "$0")
while IFS= read -r p; do
    if [[ "$my_id" != "$(stat -c %d:%i -- "$p")" ]]; then
        bin=$p
        break
    fi
done < <(type -ap evince)
[[ -z $bin ]] && exit $EX_SOFTWARE

setsid -f env DBUS_SESSION_BUS_ADDRESS= "$bin" "$@" &>/dev/null <&1
Margaret
  • 21
  • 1
  • 1
    Actually, this is great. I'm not sure without decoding quite what the rest of the wrapper is needed for, but a simple `DBUS_SESSION_BUS_ADDRESS= evince mydoc.pdf` works quite nicely for me. – andybuckley Dec 07 '20 at 23:38
  • terminated by signal SIGSEGV (Address boundary error) for MATE Document Viewer (atril) 1.24.0. It does try to open the GUI before the segfault too. Everything is bloated nowadays. – bombela Aug 05 '21 at 00:27
0

The above solutions are not flexible if you use two monitors or like the command prompt. I'm using (in .bashrc):

function open2 () { ( ln -s "$1" "L~$1"; evince "L~$1"; \rm "L~$1" ) & }
  1. This works with one file only,
  2. \rm because I have an alias rm='rm -i',
  3. evince=atril in Ubuntu Mate
zx485
  • 2,249
  • 11
  • 24
  • 34