Closed laoshaw closed 1 month ago
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 might be we need to update to library pdf.js to latest version
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
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.
@laoshaw We updated the pdf viewer lib. Can you test on try.gitea.io if it works now ?
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.
https://pdf-highlighter.com/docs/Highlighting_PDF_Viewer.html this is based on pdf.js and it seems had things integrated well too
closed by #7834
why close this so quickly?
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 ?
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.
https://usefulangle.com/post/94/javascript-pdfjs-enable-annotation-layer How to Enable Annotations in PDF.JS
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.
Any samples for test? Maybe this has been fixed.
There is no pdfjs anymore. PDF is rendered natively if it could be.
So I think it will depend on the web browser's support.
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)?