Windows: version 10
Sumatra PDF: version 3.2 64-bit
A dark mode for Sumatra PDF is really easy – you just need to tinker with 3 lines of code in the settings.
Why Use Sumatra PDF?
In my opinion, it’s the best PDF reader. It’s small in size, super-fast and doesn’t have any annoying cruft.
Why a Dark Mode (Night Mode)?
If you code for long periods of time, then it’s really great to have your code editor run in dark mode. This greatly reduces the strain on the eyes.
But let’s say you are also following along an e-book, maybe a PDF and you switch to Sumatra PDF. The default setting is black text on white background. Immediately your eyes are shocked with bright luminescent white light. It’s as if you were relaxing in a room with the lights switched off and suddenly someone walked in and abruptly turned the lights on.
As you are coding along you have to switch back and forth multiple times between your PDF reader and code editor. It can be really jarring for the eyes and nerves.
How to Enable Dark Mode?
In Sumatra PDF, click on the Menu -> Settings -> Advanced Options

This should open the SumatraPDF-settings.txt file in your text editor. Change the following 3 lines under the heading FixedPageUI:
TextColor = #eeeeee
BackgroundColor = #111111
GradientColors = #000000

TextColor changes the text color of the PDF document. Background color changes, well the background color of the PDF document. GradientColors will change the background window of Sumatra PDF.


Thanks.
LikeLiked by 1 person
Thanks
LikeLike
# Settings after this line have not been recognized by the current version (SumatraPDF v3,2 64-bit)
LikeLike
Just tested on Sumatra PDF version 3.2 64-bit and works there also. However note that the upgrade will overwrite the SumatraPDF-settings.txt file. So you will need to modify the settings file again with the directives for the dark background.
LikeLike
really thank you
LikeLike
👍
LikeLike
Doesn’t seem to work for .chm files…
LikeLike
edit: this is enabled for chm files by setting UseFixedPageUI = true in the ChmUI block. Serves to read the manual for a little longer.
LikeLiked by 1 person
Thank you for your comment on how to also implement for chm files 😊
LikeLike
Thank you very much! i ❤ foss
LikeLiked by 1 person
Absolutely. Lean FOSS is better than many a commercial bloated software!
LikeLike
Hi there, thx for this article. I just downloaded Sumatra with Ninite, and the parameter `GradientColors` doesn’t exist in the `FixedPageUI` array. Even creating it exactly as your screenshot doesn’t work. I also tested with `GradientColor` instead, didn’t work either. Am I the only one who encountered this ?
LikeLike
Hi kalak, thanks for your comment. It’s possible that the SumatraPDF version bundled with Ninite has a different configuration setting, though I can’t say for sure as I haven’t used Ninite before. Maybe try setting some other simple option via “Settings -> Advanced Options…” and see if it takes affect. If it doesn’t work then Ninite version of SumatraPDF is ignoring the default configuration file “SumatraPDF-settings.txt” and you might have to look elsewhere for the actual configuration file.
However, I can confirm that the “Dark mode” for the stand-alone version works for sure as I have used it.
LikeLike
Same for me. I don’t have the GradientColor parameter and the background of documents is still white even with all settings in above screenshot confirmed. I tried manually adding the GradientColor parameter to the txt file as well, but it didn’t work for me either.
LikeLike
Thanks a lot. I’m so glad I don’t have to use the garbage that Acrobat Reader is and have to suffer from the very high contrast bounding boxes around each citation and hyperlink that you can’t seem to disable/edit the color of and you can’t even manually remove them from the document unless you pay for the pro version. Seriously, fuck Adobe.
LikeLike
Now I can keep my eyes open safely, Thank you very much 😎👍
LikeLike
thank you
LikeLike
Thank you very very much!
These settings should be included as default or at least an option in sumatra reader.
Here’s another tip:
You may use a light grey font instead of a white font:
TextColor = #808080
Search for “hex code gray color” on the internet.
LikeLiked by 1 person
Great article, instantly made me want to read more!
There is only one issue. You can notice in the last screenshot, when you select a bookmark, it turns black, making it unreadable. Same goes for when mouse hovers over it. Do you know any fix for this?
LikeLiked by 1 person
Thanks for your feedback. Sorry I don’t know how to change the bookmark -> selected / mouse hover text color. Another problem with the dark mode is that the images get inverted (looking like film negatives). I mainly read text in PDF files, so it’s not a big problem for me with the inverted images.
LikeLike
I see, I hadn’t even noticed that.
I have figured out how to “fix” the bookmarks (setting BackgroundColor to dark gray makes it somewhat readable, which is fine by me), but proper solution would be great.
LikeLike
It doesn’t work for me, and I don’t have the option “Gradient Colors”. I am on the latest version as of Jan. 2022 (3.3.3).
LikeLike
Here. This works: https://gist.github.com/apoorvalal/fb6afb40ca01c5dc5bcbb8da098f7ed8#file-sumatra_settings-txt
LikeLike
Thanks a lot! Still working on v3.3.3
LikeLike
Let’s be honest, it’s a semi-dark-mode not a dark-mode :3
LikeLike
Is it possible to have dark mode only on Sumatra UI and not document?
LikeLike
Still works on v3.4.6 64bit, however I did need to add the line for GradientColors .
The software definitely accepted that line, and changing the hex code provoked a change.
I am really happy with it. Despite a previous comment saying “[it’s] not a dark mode” it’s fine, it was simple to implement. It took me longer to write this out than to make the change. Fantastic, 5 stars, thumb up, like, add to cart.
LikeLike