shivaprsd / doqment

Mozilla's HTML5 PDF Viewer with Reader-mode add-on. 📖
https://shivaprsd.github.io/doqment/src/pdfjs/web/viewer.html
MIT License
49 stars 1 forks source link

Dark theme not working properly for some PDFs #16

Closed Oliver-Haynes closed 3 months ago

Oliver-Haynes commented 5 months ago

image when trying to apply the firefox theme only the area behind the text changes,but when using the regular dark theme it works fine image

shivaprsd commented 5 months ago

Hi @Oliver-Haynes, probably this PDF has a big white image behind the text. Can you attach the PDF, so that I can try to reproduce the issue? Thanks!

Oliver-Haynes commented 5 months ago

Hi @Oliver-Haynes, probably this PDF has a big white image behind the text. Can you attach the PDF, so that I can try to reproduce the issue? Thanks!

https://madasmaths.com/archive/iygb_practice_papers/fp2_practice_papers/fp2_w.pdf not the same pdf but from the same place

shivaprsd commented 5 months ago

@Oliver-Haynes Yes, the PDF has a big all-white rectangular image (almost covering the page) behind the text (probably to include the vertical watermark on either sides). You can verify this by toggling the Blend Images option in the toolbar (click the ⚙️ icon near the theme name to reveal it), you can see it even in the light theme.

Some PDF apps create PDFs this way, which is sad, and the best we can do is to invert the image. But then it is nearly the same as using the "regular dark theme" (which actually is just inverting the page colours).

shivaprsd commented 3 months ago

@Oliver-Haynes Can we close this issue? It is possible to remove the watermark with any PDF editing tool. E.g. I used this online tool: https://products.aspose.app/pdf/remove-watermark, and here is the result, this PDF works fine in dark mode:

RemoveWatermark_fp2_w.pdf

P.S. be careful to select only the watermark on either sides; otherwise it removes the figures in the centre also.