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

_embed_annotations_in_file saves entire page highlighted #879

Open
zhizhongpu opened this issue Nov 29, 2023 · 1 comment
Open

_embed_annotations_in_file saves entire page highlighted #879

zhizhongpu opened this issue Nov 29, 2023 · 1 comment

Comments

@zhizhongpu
Copy link

I only highlight half of paragraph in soiyek, which works fine. But when I use the _embed_annotations_in_file command, what eventually gets saved in that file is a pdf where the entire page got highlighted.
_embed_annotations_in_file saves entire page highlighted
image
image

the pdf file i used is here: https://www.aeaweb.org/articles/pdf/doi/10.1257/jep.25.3.129

@jinjiaodawang
Copy link
Contributor

jinjiaodawang commented Dec 2, 2023

I have the same problem as you, which is reproducible on many PDF files. I found that the problem exists at:

https://github.com/ahrm/sioyek-python-extensions/blob/b2b17e0b78e990b6544e534682ea66e154bf6272/src/sioyek/sioyek.py#L843-L850

I found some cases when absolute begin is after the absolute end, causing this part of the code to select the entire page for highlighting.

You can open prefs_user.config, typically where you configed sioyek_python_extensions, and change embedding command to:

new_command _embed_annotations python3 -m sioyek.embed_annotations "%{sioyek_path}" "%{local_database}" "%{shared_database}" "%{file_path}" "fitz"

Then everything works fine, tested from my end.

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

2 participants