gitea can not show pdf annotation #3432

Closed
opened 2025-11-02 05:12:45 -06:00 by GiteaMirror · 16 comments
Owner

Originally created by @laoshaw on GitHub (Jun 5, 2019).

Running gitea 1.8.2 on Linux and just noticed the PDF with highlights are not shown highlights, just the original PDF, can gitea support pdf annotation like normal pdf readers(evince,etc)?

Originally created by @laoshaw on GitHub (Jun 5, 2019). Running gitea 1.8.2 on Linux and just noticed the PDF with highlights are not shown highlights, just the original PDF, can gitea support pdf annotation like normal pdf readers(evince,etc)?
GiteaMirror added the issue/confirmedtype/enhancement labels 2025-11-02 05:12:45 -06:00
Author
Owner

@kolaente commented on GitHub (Jun 9, 2019):

IIRC Gitea does not render the pdf itself, it uses pdf.js or just lets the browser render the pdf. So this is more likely to be an issue with your Browser, not Gitea.

@kolaente commented on GitHub (Jun 9, 2019): IIRC Gitea does not render the pdf itself, it uses pdf.js or just lets the browser render the pdf. So this is more likely to be an issue with your Browser, not Gitea.
Author
Owner

@lafriks commented on GitHub (Jun 13, 2019):

@kolaente might be we need to update to library pdf.js to latest version

@lafriks commented on GitHub (Jun 13, 2019): @kolaente might be we need to update to library pdf.js to latest version
Author
Owner

@zeripath commented on GitHub (Jun 13, 2019):

Wow it looks like our pdfjs is quite old... v1.4.20

https://github.com/mozilla/pdf.js/releases/download/v2.0.943/pdfjs-2.0.943-dist.zip

is the most recent version

@zeripath commented on GitHub (Jun 13, 2019): Wow it looks like our pdfjs is quite old... v1.4.20 https://github.com/mozilla/pdf.js/releases/download/v2.0.943/pdfjs-2.0.943-dist.zip is the most recent version
Author
Owner

@stale[bot] commented on GitHub (Aug 12, 2019):

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.

@stale[bot] commented on GitHub (Aug 12, 2019): This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.
Author
Owner

@sapk commented on GitHub (Aug 13, 2019):

@laoshaw We updated the pdf viewer lib. Can you test on try.gitea.io if it works now ?

@sapk commented on GitHub (Aug 13, 2019): @laoshaw We updated the pdf viewer lib. Can you test on try.gitea.io if it works now ?
Author
Owner

@laoshaw commented on GitHub (Aug 13, 2019):

Just did a quick test unfortunately it basically still is not working, only a pop-up notes shown, all the highlight underline etc are no-shows.

@laoshaw commented on GitHub (Aug 13, 2019): Just did a quick test unfortunately it basically still is not working, only a pop-up notes shown, all the highlight underline etc are no-shows.
Author
Owner

@laoshaw commented on GitHub (Aug 13, 2019):

https://pdf-highlighter.com/docs/Highlighting_PDF_Viewer.html this is based on pdf.js and it seems had things integrated well too

@laoshaw commented on GitHub (Aug 13, 2019): https://pdf-highlighter.com/docs/Highlighting_PDF_Viewer.html this is based on pdf.js and it seems had things integrated well too
Author
Owner

@lunny commented on GitHub (Aug 14, 2019):

closed by #7834

@lunny commented on GitHub (Aug 14, 2019): closed by #7834
Author
Owner

@laoshaw commented on GitHub (Aug 14, 2019):

why close this so quickly?

@laoshaw commented on GitHub (Aug 14, 2019): why close this so quickly?
Author
Owner

@sapk commented on GitHub (Aug 14, 2019):

We shouldn't have close it if not fixed.
I don't know a lot concerning pdf possibility but Highlighting PDF Viewer seems to need a serve side part.

Our viewer extension receives highlighting meta-data from the server and marks keywords in PDF viewer

Have you try to open your pdf with it ?

@sapk commented on GitHub (Aug 14, 2019): We shouldn't have close it if not fixed. I don't know a lot concerning pdf possibility but Highlighting PDF Viewer seems to need a serve side part. > Our viewer extension receives highlighting meta-data from the server and marks keywords in PDF viewer Have you try to open your pdf with it ?
Author
Owner

@laoshaw commented on GitHub (Aug 14, 2019):

new pdf.js supposedly should be able to open annotation somehow it did not work under gitea yet. i have not used highlight-pdf-viewer myself. I will try to debug when I become more familiar with golang.

@laoshaw commented on GitHub (Aug 14, 2019): new pdf.js supposedly should be able to open annotation somehow it did not work under gitea yet. i have not used highlight-pdf-viewer myself. I will try to debug when I become more familiar with golang.
Author
Owner

@laoshaw commented on GitHub (Aug 14, 2019):

https://usefulangle.com/post/94/javascript-pdfjs-enable-annotation-layer How to Enable Annotations in PDF.JS

@laoshaw commented on GitHub (Aug 14, 2019): https://usefulangle.com/post/94/javascript-pdfjs-enable-annotation-layer How to Enable Annotations in PDF.JS
Author
Owner

@sapk commented on GitHub (Aug 14, 2019):

If you want to give it a try, pdfjs is now on the latest version and we load the viewer of pdfjs here : bcbc9f33d7/templates/repo/view_file.tmpl (L66)
The viewer is located here : https://github.com/go-gitea/gitea/tree/master/public/vendor/plugins/pdfjs

I don't think you will need to learn Go (just need to install it) to fix this as it is more a frontend problem.
The command : TAGS=sqlite make clean generate build && ./gitea should be enough to start locally gitea with your changes.

Don't hesitate to open a PR to discuss over your code.

@sapk commented on GitHub (Aug 14, 2019): If you want to give it a try, pdfjs is now on the latest version and we load the viewer of pdfjs here : https://github.com/go-gitea/gitea/blob/bcbc9f33d73393c47b27793ac91b8f9faf98d349/templates/repo/view_file.tmpl#L66 The viewer is located here : https://github.com/go-gitea/gitea/tree/master/public/vendor/plugins/pdfjs I don't think you will need to learn Go (just need to install it) to fix this as it is more a frontend problem. The command : `TAGS=sqlite make clean generate build && ./gitea` should be enough to start locally gitea with your changes. Don't hesitate to open a PR to discuss over your code.
Author
Owner

@yp05327 commented on GitHub (Sep 19, 2024):

Any samples for test? Maybe this has been fixed.

@yp05327 commented on GitHub (Sep 19, 2024): Any samples for test? Maybe this has been fixed.
Author
Owner

@wxiaoguang commented on GitHub (Sep 19, 2024):

There is no pdfjs anymore. PDF is rendered natively if it could be.

@wxiaoguang commented on GitHub (Sep 19, 2024): There is no pdfjs anymore. PDF is rendered natively if it could be.
Author
Owner

@lunny commented on GitHub (Sep 19, 2024):

So I think it will depend on the web browser's support.

@lunny commented on GitHub (Sep 19, 2024): So I think it will depend on the web browser's support.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#3432