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

gitea can not show pdf annotation #7139

Closed
laoshaw opened this issue Jun 5, 2019 · 16 comments
Closed

gitea can not show pdf annotation #7139

laoshaw opened this issue Jun 5, 2019 · 16 comments
Labels
issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented type/enhancement An improvement of existing functionality

Comments

@laoshaw
Copy link

laoshaw commented 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)?

@lunny lunny added the type/enhancement An improvement of existing functionality label Jun 6, 2019
@kolaente
Copy link
Member

kolaente commented 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.

@lafriks
Copy link
Member

lafriks commented Jun 13, 2019

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

@zeripath
Copy link
Contributor

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

@stale
Copy link

stale bot commented 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 stale bot added the issue/stale label Aug 12, 2019
@lunny lunny added the issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented label Aug 13, 2019
@stale stale bot removed the issue/stale label Aug 13, 2019
@sapk
Copy link
Member

sapk commented Aug 13, 2019

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

@laoshaw
Copy link
Author

laoshaw commented 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
Copy link
Author

laoshaw commented 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

@lunny
Copy link
Member

lunny commented Aug 14, 2019

closed by #7834

@lunny lunny closed this as completed Aug 14, 2019
@laoshaw
Copy link
Author

laoshaw commented Aug 14, 2019

why close this so quickly?

@sapk
Copy link
Member

sapk commented 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 ?

@laoshaw
Copy link
Author

laoshaw commented 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
Copy link
Author

laoshaw commented Aug 14, 2019

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

@sapk
Copy link
Member

sapk commented 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 :

<iframe width="100%" height="600px" src="{{AppSubUrl}}/vendor/plugins/pdfjs/web/viewer.html?file={{EscapePound $.RawFileLink}}"></iframe>

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.

@yp05327
Copy link
Contributor

yp05327 commented Sep 19, 2024

Any samples for test? Maybe this has been fixed.

@wxiaoguang
Copy link
Contributor

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

@lunny
Copy link
Member

lunny commented Sep 19, 2024

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

@lunny lunny closed this as completed Sep 19, 2024
@go-gitea go-gitea locked as resolved and limited conversation to collaborators Dec 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented type/enhancement An improvement of existing functionality
Projects
None yet
Development

No branches or pull requests

9 participants