ENH: Add Highlight text markup annotation#1740
Conversation
|
I've got the quadpoints by using pymupdf and inspecting the resulting document: import fitz
doc = fitz.open("crazyones.pdf")
page = doc[0]
text_instances = page.search_for("crazy")
for inst in text_instances:
highlight = page.add_highlight_annot(inst)
highlight.set_colors({"stroke":(0, 0, 1), "fill":(0.75, 0.8, 0.95)})
highlight.update()
doc.save("annotation.pdf")@pubpub-zz How difficult would a |
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #1740 +/- ##
=======================================
Coverage 92.38% 92.38%
=======================================
Files 34 34
Lines 6553 6557 +4
Branches 1300 1301 +1
=======================================
+ Hits 6054 6058 +4
Misses 326 326
Partials 173 173
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report in Codecov by Sentry. |
It will be part of the extension of extract_text... I raise it in the stack |
|
the inprogress PR #1723 about set_color should also allow to change the color : definitively |
Security (SEC): - Use Python's secrets module instead of random module (#1748) New Features (ENH): - Add AnnotationBuilder.highlight text markup annotation (#1740) - Add AnnotationBuilder.popup (#1665) - Add AnnotationBuilder.polyline annotation support (#1726) - Add clone_from parameter in PdfWriter constructor (#1703) Bug Fixes (BUG): - 'DictionaryObject' object has no attribute 'indirect_reference' (#1729) Robustness (ROB): - Handle params NullObject in decode_stream_data (#1738) Documentation (DOC): - Project scope (#1743) Maintenance (MAINT): - Add AnnotationFlag (#1746) - Add LazyDict.__str__ (#1727) [Full Changelog](3.6.0...3.7.0)
See #107