26

Is there any way I can convert my PDF into a dark mode version without converting it into images first and invert that image and combine them, instead simply invert every element in the PDF and make it dark (preserving the original text and hyperlinks). appreciate any help!

all 13 comments
sorted by: hot top controversial new old
[-] roflo1@feddit.nl 18 points 3 days ago* (last edited 2 days ago)

I don’t remember where I got this, I just jotted it down in my notes.

gs -o inverted.pdf -sDEVICE=pdfwrite -c "{1 exch sub}{1 exch sub}{1 exch sub}{1 exch sub} setcolortransfer" -f original.pdf

Edit: this might well be the original post I found: https://stackoverflow.com/a/30287097

[-] Override4414@lemmy.world 2 points 6 hours ago

thx a lot!!!

[-] catloaf@lemm.ee 2 points 3 days ago

If it works for your use case. Dark Reader and a Firefox PDF tab works.

[-] Override4414@lemmy.world 2 points 3 days ago

Can I save it locally as an inverted pdf?

[-] catloaf@lemm.ee 3 points 3 days ago

No, but you can open it locally in Firefox. You'd just have to use that as your reader. Unfortunately I don't know if any other readers have a dark mode feature; I only discovered Dark Reader working for PDFs by accident.

[-] Override4414@lemmy.world 1 points 6 hours ago

thx I will look into that

[-] ruk_n_rul@monyet.cc 1 points 3 days ago

SumatraPDF can.... But it's a Windows only program (run with wine, perhaps?)

[-] maxprime@lemmy.ml 3 points 3 days ago

zathura does this as well

this post was submitted on 12 May 2025
26 points (100.0% liked)

Open Source

36823 readers
100 users here now

All about open source! Feel free to ask questions, and share news, and interesting stuff!

Useful Links

Rules

Related Communities

Community icon from opensource.org, but we are not affiliated with them.

founded 5 years ago
MODERATORS