this post was submitted on 12 May 2025
25 points (93.1% liked)

Open Source

36988 readers
103 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
 

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 7 comments
sorted by: hot top controversial new old
[–] [email protected] 19 points 1 week ago* (last edited 1 week ago) (1 children)

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

[–] [email protected] 2 points 1 week ago

thx a lot!!!