Live data from Hacker News

Show HN: PDF Inverter for macOS (In Golang) Darken Your PDFs

github.com

11–20 of 38 posts

Re: Show HN: PDF Inverter for macOS (In Golang) Darken Your PDFs

#13
post #3

Not sure why this needs a dedicated application, you can do this in Chrome or FF with a single line of JS: javascript:(function(){viewer.style = 'filter: grayscale(1) invert(1) sepia(1) contrast(75%)';})()

That does not work with the Chrome PDF viewer for me. (Chrome 87, Mac)

Re: Show HN: PDF Inverter for macOS (In Golang) Darken Your PDFs

#16
post #3

Not sure why this needs a dedicated application, you can do this in Chrome or FF with a single line of JS: javascript:(function(){viewer.style = 'filter: grayscale(1) invert(1) sepia(1) contrast(75%)';})()

Hmm, for me, following works with Google Chrome PDF viewer:

Bookmarklet

javascript:(function() { var v = document.getElementsByTagName("html"); v[0].style.background = "white"; v[0].style.filter = "invert(90%) sepia(60%) brightness(70%)"; v[0].style.backgroundColor = "black"; document.getElementsByTagName("body")[0].style.background = "white"; })();

Re: Show HN: PDF Inverter for macOS (In Golang) Darken Your PDFs

#17
post #3

Not sure why this needs a dedicated application, you can do this in Chrome or FF with a single line of JS: javascript:(function(){viewer.style = 'filter: grayscale(1) invert(1) sepia(1) contrast(75%)';})()

That does not work with the Chrome PDF viewer for me. (Chrome 87, Mac)

Which PDF viewer? 87 has a test running for a new version.

chrome://flags/#pdf-viewer-update

Re: Show HN: PDF Inverter for macOS (In Golang) Darken Your PDFs

#18
We went full dark mode when we released the 2.0 version of our app which has PDF and EPUB support:

https://getpolarized.io/2020/10/05/Polar-2-0-Release.html

the issue we had was that we were using a CSS filter like other commenters mentioned.

The problem is that it inverts images too and pdfjs doesn't actually specify which parts of the document are an image as it's just writing to a canvas.

My plan moving forward is to fix pdfjs so it can invert natively and the actual canvas is inverted so that images won't be inverted.

I think figures would STILL be a problem though.

EPUBs are much easier and we're not inverting there because we can see which one is an img.

Re: Show HN: PDF Inverter for macOS (In Golang) Darken Your PDFs

#19
post #14
post #10

So PDF viewers apps on MacOS do not support color changing by way of accessibility options?

Why would that be a feature of an application? That’s an OS function ( https://www.apple.com/accessibility/mac/vision/ )

one bad thing about this is that if you also like to redshift your color temperature, you cannot have that and the OS-level invert on at the same time (last time I checked). Hence, inverting the pdf file itself allows you to have the best of both worlds.

Re: Show HN: PDF Inverter for macOS (In Golang) Darken Your PDFs

#20

We went full dark mode when we released the 2.0 version of our app which has PDF and EPUB support: https://getpolarized.io/2020/10/05/Polar-2-0-Release.html the issue we had was that we were using a CSS filter like other commenters mentioned. The problem is that it inverts images too and pdfjs doesn't actually specify which parts of the document are an image as it's just writing to a canvas. My plan moving forward is…

Didn’t the getpolarized spam used to come from a different account?
Post reply on HN