Add dark mode to native Brave PDF reader

I find it especially useful to open PDF files in Brave because it allows me to both read and meanwhile search up information in another tab.

But Brave’s own Dark Mode does not work on PDF files.
So any file that begins with file:///C:/Users/name/Documents/SomeFile.pdf is still shining black text on white background. It would be great to have a toggle option to switch to ‘darkmode’ by inverting the color of the page itself.


This is what I mean:

Normal situation where PDF files do not have a dark mode:

.

Necessary changes:

.

Or a complete invert:

Unfortunately, I don’t think there is a way to enable dark mode for local PDF files in Brave at this time. This is because the dark mode feature is built into Chromium, which is the open-source project that Brave is based on. Chromium does not currently have a way to enable dark mode for local PDF files.

However, you can try to Enable the “Force Dark Mode” flag: This flag will force dark mode to be enabled for all web pages, including local PDF files. However, it is important to note that this flag is still under development and may not work perfectly. To enable the “Force Dark Mode” flag, go to brave://flags/#enable-force-dark and set the flag to “Enabled”.

Note

I am actually replying from my phone and I may not be fully accurate on that flag. Usually I would double check on my computer before I say anything but I wanted to put it there just in case it helps you out. I’ll try to follow up with this topic later.

1 Like

Thank you for the suggestion! I tried different options under this flag, including selective inversion and generic inversion of all content (with which it means both html and images within the browser).

Unfortunately the PDF type is not supported with this flag so it does not work on either PDFs viewed within another website (without downloading, either in a small window or new tab) or local PDFs that are opened from hard drive.

But it was at least something worth trying!
Maybe the standard chromium PDF-viewer will eventually receive an ‘inverse option.’ Right now the options are limited to this:

1 Like

So nobody uses Brave PDF reader to read at night apparently?
I thought this post might get some traffic…

Or I guess they are like me, where don’t really use dark mode. If I am right about this being a chromium issue (I had cheated and used AI to confirm this before posting), then you’d likely do better looking to see if it’s an open issue there. If not, perhaps create an issue yourself. Anything upstream hardly sees the light of day through Brave, just because they have a limited amount of people and it’s easier and more efficient to let the bigger company upstream fix it while smaller team works on the unique aspects downstream.

You’re right, that’s probably it. I will see if I can find a contribution page for Chromium.

Hi, is changing this flag detectable, similar as it is possible to detect “dark reader” type extensions? Thanks.

What do you mean with detectable? That you can see that the flag setting is turned on? In that case only when you go to brave//flags/#enable-force-dark.

But currently I am using the extension DarkPDF, or when it’s a white image with text which I want to reverse (if Midnight Lizard does not pick it up), I will use Inverto color fixer.

The extensions seem trustworthy but use at your own risk. I turn them off when I don’t need them.

Nowadays I also use a professional PDF reader called PDF Reader Pro. It is quite buggy and does not allow you to copy text after you have highlighted it. But it is a one-time buy and is way cheaper than using Adobe Acrobat Pro’s monthly subscription which is extremely expensive.

This is a lot of fuss for a simple dark mode for PDFs, but it works. I have also requested Midnight Lizard to work on native PDFs (PDFs from the C disk) but this might feature might not get adapted because of security issues.

In addition to DarkPDF there is also the “doqment” extension which allows for more control over the theme. It can also be installed from the chrome extension store.

Source code: https://github.com/shivaprsd/doqment