sumatraInitialize {berryFunctions}R Documentation

Set useful Sumatra PDF Viewer default settings

Description

Set useful Sumatra PDF Viewer default settings. This will likely only work on windows. At the given path with "SumatraPDF.exe", this creates two settings files. Existing files are renamed ("_old_n" appended), not overwritten.
Creates "sumatrapdfrestrict.ini" with SavePreferences = 1 and FullscreenAccess = 1.
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("pandoc$", "sumatra", Sys.getenv("RSTUDIO_PANDOC")),
  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: extracted from Sys.getenv("RSTUDIO_PANDOC"), e.g. "C:/Program Files/RStudio/bin/sumatra"

roampath

if not NULL, both files are also copied to this path, e.g. C:/Users/berry/AppData/Roaming/SumatraPDF. DEFAULT: SumatraPDF folder at Sys.getenv("APPDATA")

openfolder

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

Value

path, invisibly

Author(s)

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

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


[Package berryFunctions version 1.22.0 Index]