sumatraInitialize: Set useful Sumatra PDF Viewer default settings

View source: R/sumatraInitialize.R

sumatraInitializeR Documentation

Set useful Sumatra PDF Viewer default settings

Description

Set useful Sumatra PDF Viewer default settings. This will only work on windows. Existing files are renamed ("_old_n" appended), not overwritten.
At the given path with "SumatraPDF.exe", it creates "sumatrapdfrestrict.ini" with SavePreferences = 1 and FullscreenAccess = 1.
At the given roampath, it creates "SumatraPDF-settings.txt" with ShowToc = false and DefaultDisplayMode = single page. UiLanguage gets filled in by Sumatra itself upon first opening.

Usage

sumatraInitialize(
  path = sub("rstudio.exe$", "resources/app/bin/sumatra",
    Sys.getenv("RSTUDIO_DESKTOP_EXE")),
  roampath = paste0(Sys.getenv("APPDATA"), "/SumatraPDF"),
  openfolder = TRUE
)

Arguments

path

Folder (not file) that contains "SumatraPDF.exe". You need file writing permissions in the folder. DEFAULT: equivalent of "C:/Program Files/RStudio/resources/app/bin/sumatra"

roampath

Folder that will contain "SumatraPDF-settings.txt". DEFAULT: equivalent of "C:/Users/berry/AppData/Roaming/SumatraPDF"

openfolder

Logical: Open folders after writing the files? Uses openFile(). DEFAULT: TRUE

Value

path, invisibly

Author(s)

Berry Boessenkool, berry-b@gmx.de, May 2020, Nov 2023

See Also

openPDF
https://www.sumatrapdfreader.org/settings/settings.html
https://github.com/sumatrapdfreader/sumatrapdf/blob/master/docs/sumatrapdfrestrict.ini

Examples

# sumatraInitialize() # only run in interactive mode


berryFunctions documentation built on May 29, 2024, 4:01 a.m.