-
-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FR] Dark Mode Support in Scanned PDFs (Images) #279
Comments
Hello LeonelRFF, And sorry that I could not help you with the scanned PDFs. It would be nice if it worked! |
PSA: deleted a potential spam comment. The comment author posted the exact same text in 4 of the issues in this repository at almost the same time, and the text included an unknown link. I also reported the account to GitHub. |
That's right, I saw it |
@LeonelRFF Note that the dark mode for the pdf viewer which you've pointed out is actually a feature of vanilla obsidian. Below is a CSS snippet that hopefully works to invert image-based/image-only pdfs: .theme-dark .pdf-container:has(.textLayer :first-child.endOfContent) canvas {
filter: invert(1);
} I don't know much about pdfs or why obsidian doesn't invert these image-only ones already so this is a bit of a guess but it seems to work for this one: https://nlsblog.org/wp-content/uploads/2020/06/image-based-pdf-sample.pdf Note that all of the above has nothing to do with this plugin. However, if you want rectangular pdf embeds from this plugin to be in dark mode then this snippet works: .theme-dark .pdf-cropped-embed {
filter: invert(1);
} Feel free to play around with the CSS rule a bit to get it looking nicer (eg. reduce the invert and change the brightness and contrast too - you can copy what some themes do). @RyotaUshio there isn't an option in the plugin to invert the rectangular embeds by default is there? I might have just missed it so let me know and I can update this comment if so. |
In the latest version of Obsidian, I use this css selector to invert the pdf: .theme-dark .pdf-viewer {
filter: invert(0.85);
} And it works for scanned PDFs. However, now I prefer and recommend this smart solution https://github.com/harttraveller/obsidian-pdf-color-inverter. By simply duplicating and renaming the original PDF, we can have both original and inverted versions simultaneously in case that the brutal |
Describe your request
Hello, I would like to ask about the possibility of incorporating dark mode for scanned PDFs, that is, those that are only images and are not editable since they do not contain selectable text. I suppose it is different since the color of the images would have to be inverted.
As for the dark mode for the rest of the PDFs that I use, it works well 👌
Regards
The text was updated successfully, but these errors were encountered: