mupdf: add annotation type and contents getters#2287
Merged
Conversation
Frenzie
reviewed
Mar 5, 2026
| cdecl_func(mupdf_pdf_next_annot) | ||
| cdecl_func(mupdf_pdf_annot_quad_point_count) | ||
| cdecl_func(mupdf_pdf_annot_quad_point) | ||
| cdecl_func(mupdf_pdf_annot_type) |
Member
There was a problem hiding this comment.
The annotations header puts pdf_annot_type at the start. I think I'd rather keep the original order unless there's a good reason to deviate.
97025d5 to
cbdf3e5
Compare
Member
|
So |
cbdf3e5 to
6ccc40b
Compare
Contributor
Author
|
Correct. Removed both |
Member
|
Isn't this still a prerequisite for koreader/koreader#15075? |
Contributor
Author
|
Yes, still needed. Accidentally deleted the branch while cleaning up |
Frenzie
approved these changes
Mar 6, 2026
Frenzie
added a commit
to Frenzie/koreader
that referenced
this pull request
Mar 8, 2026
* cmake: cleanup some glibc version conditionals koreader/koreader-base@17b401c * xz: avoid pulling __sched_cpucount@GLIBC_2.6 on older glibc versions koreader/koreader-base@af4e241 * mupdf: add annotation type and contents getters koreader/koreader-base#2287
Frenzie
added a commit
to Frenzie/koreader
that referenced
this pull request
Mar 8, 2026
* cmake: cleanup some glibc version conditionals koreader/koreader-base@17b401c * xz: avoid pulling __sched_cpucount@GLIBC_2.6 on older glibc versions koreader/koreader-base@af4e241 * mupdf: add annotation type and contents getters koreader/koreader-base#2287
Frenzie
added a commit
to koreader/koreader
that referenced
this pull request
Mar 8, 2026
* cmake: cleanup some glibc version conditionals koreader/koreader-base@17b401c * xz: avoid pulling __sched_cpucount@GLIBC_2.6 on older glibc versions koreader/koreader-base@af4e241 * mupdf: add annotation type and contents getters koreader/koreader-base#2287
benoit-pierre
pushed a commit
to benoit-pierre/koreader
that referenced
this pull request
Mar 16, 2026
0xstillb
pushed a commit
to 0xstillb/koreader-thai
that referenced
this pull request
May 9, 2026
…er#15092) * cmake: cleanup some glibc version conditionals koreader/koreader-base@17b401c * xz: avoid pulling __sched_cpucount@GLIBC_2.6 on older glibc versions koreader/koreader-base@af4e241 * mupdf: add annotation type and contents getters koreader/koreader-base#2287
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Expose
pdf_annot_type()andpdf_annot_contents()from MuPDF as FFI-accessible getters.koreader-base currently wraps setter functions for annotation properties (
pdf_set_annot_contents,pdf_create_annotwith type) but not the corresponding getters. This means code that imports embedded PDF annotations can read quadpoint coordinates but cannot read the annotation type (Highlight vs Underline vs StrikeOut) or the/Contentsfield (user notes).Changes
wrap-mupdf.h: Addmupdf_pdf_annot_typeandmupdf_pdf_annot_contentswrappersffi-cdecl/wrap-mupdf_cdecl.c: Export the two new functionsffi/mupdf_h.lua: Add FFI declarationsffi/mupdf.lua: AddgetEmbeddedAnnotations()-- returns type, quadpoint boxes, and contents for each markup annotation (Highlight, Underline, Squiggly, StrikeOut), filtering out Links, Popups, Widgets, etc.Context
Needed by koreader/koreader#15075 to fix the embedded annotation import feature.
This change is