Open silverwind opened 2 years ago
Or maybe just replace it entirely with https://pdfobject.com/, which is a browser-native pdf viewer. Only issue is that it won't work on mobile at all, so we would display a download link instead then.
This issue has been automatically marked as stale because it has not had recent activity. I am here to help clear issues left open even if solved or waiting for more insight. This issue will be closed if no further activity occurs during the next 2 weeks. If the issue is still valid just add a comment to keep it alive. Thank you for your contributions.
I created a PoC https://github.com/aceArt-GmbH/gitea/commit/b8cee55f91291076440ca0d986288af7f56bb865 using pdfobject. PDFs should work in latest firefox for android.
Opinions on the issue and the solution? (also technical)
before -> after
I did not consider PDFObject so far because of lacking mobile support.
Also see https://github.com/go-gitea/gitea/issues/23994. I think what we should do is to have a viewer-less pdf.js rendering, similar to GitLab or GitHub.
https://github.com/go-gitea/gitea/tree/main/public/vendor/plugins/pdfjs contains a outdated vendored copy of pdf.js. We should instead find a way to load pdf.js via webpack.
The main challenge will be that the "viewer" component (which is basically all the UI for pdf.js) is not part of the official pdf.js distribution, so we need some way to sideload it or some other similar UI, maybe https://github.com/hediet/pdf.js-viewer.