Change window size when opening pdf from archive manager

Evince appears to "remember" window sizes on a per file base. It is all very obscure and there is, frustratingly, little control on the window size.

Caveat The following options will act on all new Evince windows, not only those opened from an archive as asked.

Maximize using Devilspie

I use Devilspie2 to ensure that each Evince window (whether the PDF is in an archive or not) is maximized on opening. This is a little (and unfortunately old, unmaintained and poorly documented) daemon program. It watches when a new window is created. If the window matches a criterion (e.g. it is an Evince window), then it will apply the rule you defined for these types of windows (i.e., the window is maximized).

• You can install Devilspie2 with the command sudo apt install devilspie2.

• You need to create a configuration file ~/.config/devilspie2/devilspie2.lua to define the rules.

This is my rule for Evince windows:

--Evince Document Viewer

if (not string.match(get_window_property("_NET_WM_STATE"),"_NET_WM_STATE_SKIP_PAGER") and get_application_name() == "Document Viewer" and get_window_name() ~= "Open Document" and get_window_name() ~= "Print" and get_window_name() ~= "Save As…" and get_window_name() ~= "Properties") then
   maximize();
end

The match criterion is rather complicated. It ensures that open and save dialogs, and PDF annotations, are not matched: for example, you do not want a maximized yellow note when you open one.

The action is very simple: maximize the window.

• For this to be enabled when you login, add devilspie to your autostart program. I found I need some delay for it to work, so my autostart command reads:

sh -c "sleep 8 && devilspie2 &"

Full screen via Evince command line option

Unfortunately, Evince has no command line option to start it maximized. However, there is a command line option to start it full screen. If that would be acceptable, you could launch Evince with the -f option. To achieve that, edit the .desktop launcher for Evince.