Skip to content
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

Colored PDF only shown in grayscale and broken in request #401

Closed
rugk opened this issue Dec 18, 2020 · 10 comments
Closed

Colored PDF only shown in grayscale and broken in request #401

rugk opened this issue Dec 18, 2020 · 10 comments

Comments

@rugk
Copy link
Contributor

rugk commented Dec 18, 2020

In a little embarrassing conversation I had to notice that the PDF the agency sent to me is disturbed:
The following energy performance certificate is correctly shown to me in a local PDF viewer (Envince 3.38.0 on GNOME), b ut broken on the website:
https://fragdenstaat.de/anfrage/energiebedarfsausweis-fur-gebaude-landesbetrieb-information-und-technik-nordrhein-westfalen-mauerstrae-5-140476-dusseldorf/550050/anhang/WE2330Ausweis_2.pdf

I know you can do nothing here, and noticed it is actually an issue in PDF.js, so I've opened this issue:
mozilla/pdf.js#12752

Just in case someone else has a similar issue or get the documents from the same agency (Bau- und Liegenschaftsbetrieb NRW), you now know what is causing this. And you can close this if upstream has fixed this issue and you've updated your platform.

@arnese
Copy link
Collaborator

arnese commented Dec 18, 2020

Perspektivisch werden das sowieso alles Dokumente wie hier schon mal gemacht. https://fragdenstaat.de/dokumente/7996-we2330ausweis_2/

@rugk
Copy link
Contributor Author

rugk commented Dec 18, 2020

Ah danke! Das ist ja cool.

@alehaa
Copy link
Contributor

alehaa commented Dec 22, 2020

Hier habe ich dasselbe Problem, nach einem Download kann ich die Datei aber "normal" betrachten.

@arnese es wurde Upstream inzwischen ein Patch bereitgestellt. Könnt Ihr diesen ggf. auf FdS deployen?

@arnese
Copy link
Collaborator

arnese commented Dec 22, 2020

@alehaa nächstes Jahr :)

@Ryuno-Ki
Copy link

Also dieses?

@stefanw
Copy link
Member

stefanw commented Feb 2, 2021

I tried to upgrade to latest pdf.js viewer, but there are problems with our CSP disallowing eval. Feel free to make latest pdf.js viewer work without eval and let me know how it goes.

@rugk
Copy link
Contributor Author

rugk commented Feb 2, 2021

How do you include it and what are the errors?
Because this seems to be a well-known error, see mozilla/pdf.js#12105, actually mozilla/pdf.js#11036, a downstream dependency of PDF.js seems to have an issue.

So could you switch to:

A modern build (for up-to-date browsers), which is not transpiled with Babel and without any included polyfills.


That said, BTW, the last pdf.js release AFAIK does not include the patch for this issue (look at the dates). It's not released yet.
That said, updating pdf.js never hurts, you need to do it anyway at some point.

@stefanw
Copy link
Member

stefanw commented Feb 2, 2021

We can‘t use a version that breaks CSP or breaks older browser compat (older here means does not support things like optional chaining which is quite a few). We are using the viewer from pdf.js demo with some changes (no url validation, eval off, de locale, reduced toolbar): https://github.com/okfde/django-filingcabinet/tree/master/filingcabinet/static/filingcabinet/viewer

@alehaa
Copy link
Contributor

alehaa commented May 12, 2021

Is there any update on this issue? I'm still observing it in some request answered by a specific authority.

@stefanw
Copy link
Member

stefanw commented Jul 28, 2021

PDF.js has been updated to latest stable version. The mentioned PDFs are now rendering ok.

Where PDFs are just shown (via iframe) we are no longer using a bundled version of pdf.js but the native browser PDF viewer (which for Firefox is pdf.js). PDF.js is used to augment our document viewer, in the redaction process and for attachment previews in the message attachment manager.

@stefanw stefanw closed this as completed Jul 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants