@JohnRob
Actually back link was thanks to SumatraPeter
For your needs a similar issue was discussed on GitHub where I suggested running Find and replace text which should work in the background as you browse
see Feed in the settings file as a command line argument · Issue #1027 · sumatrapdfreader/sumatrapdf · GitHub
If you want to access internally from SumatraPDF menu you could add the two alternating values as Open in Dark Theme and Open in Light Theme in the files menu.
In this case you will need slight changes to the settings files, first find where your settings file is, portable users will usually keep it in the app folder, however most installations will keep it in the users AppData\Roaming folder. Easiest way is starting advanced setting and in notepad initiate “save as” that will confirm where the current settings are loaded from.
Place a copy of FART.EXE from FARTing the Easy Way - Find And Replace Text - Mikail's Blog in the same settings folder. Then also in that folder make two files by cut and paste the following with notepad
@%~dp0fart.exe -i -q %~dp0SumatraPDF-settings.txt "BackgroundColor = #F8F0F8" "BackgroundColor = #F0F0C0"
@copy %~dp0SumatraPDF-settings.txt %~dp0SumatraPDF-settings.tmp
@copy %~dp0SumatraPDF-settings.tmp %~dp0SumatraPDF-settings.txt
NOTE that is THREE lines where the first line does all the work, just make sure the #values are not the same. save the first file as say DARK.CMD (actually it is sort of a parchment colour). The extra two copy lines may seem daft however although the one line works when called from outside SumatraPDF (as it sees an external change), we will be using them from inside and SumatraPDF does not see a change at that time however we need to trigger it as if it changed the settings file. NOTE only time will tell if this is a problem later.
for LIGHT.CMD we just need to reverse the two values and save it so it looks like this
@%~dp0fart.exe -i -q %~dp0SumatraPDF-settings.txt "BackgroundColor = #F0F0C0" "BackgroundColor = #F8F0F8"
@copy %~dp0SumatraPDF-settings.txt %~dp0SumatraPDF-settings.tmp
@copy %~dp0SumatraPDF-settings.tmp %~dp0SumatraPDF-settings.txt
It is important we use the same alternating value so it acts as a simple switch (you can change them but always change them in pairs and see later that the .TXT file has either one to start) OK now for the fun bit in SumatraPDF-settings.txt ensure you have
UseSysColors = false
Otherwise the system themes will override our custom settings then under FixedPageUI
change the background value to EITHER of the ones we are currently using for example
BackgroundColor = #F8F0F8
now find the ExternalViewers section and change it with the correct location above to look something like this
ExternalViewers [
[
CommandLine = "C:\Users\**_your name_**\AppData\Roaming\SumatraPDF\dark.cmd"
Name = Dark Theme
Filter = *.*
]
[
CommandLine = "C:\Users\**_your name_**\AppData\Roaming\SumatraPDF\light.cmd"
Name = Light Theme
Filter = *.*
]
]
If your really adventurous you can add other lines to each theme.CMD to change the
MainWindowBackground = #80fff280
TextColor = #000000
avoid changing it too much unless you want an inverted theme, also if you are using the pre-release you could change the GradientColors margin as shown above
OR even flip e-pub user interface from true to false (but there is now a toggle switch in the debug menu to make that a no brainer)
if it all goes wrong simply delete the SumatraPDF-settings file and next time you will be back to a default setup (without a file history ) I did remind you to make a backup, somewhere else, didn’t I ?