Skip to content

Small size after apply fitz.TOOLS.set_small_glyph_heights(True) #3514

Answered by JorjMcKie
Muhammadraafat1 asked this question in Q&A
Discussion options

You must be logged in to vote

Have converted this to a Discussions post.

The automatic text replacement implemented inside redactions is a convenience - inevitably coming with some restrictions as to how much this can be influenced.

If your needs go beyond, you must adapt your approach and do text replacement in multiple steps:

  1. Extract old text and determine its properties like font size, text color, maybe also font, insertion point etc.
  2. Remove the old text without specifying a replacement.
  3. Insert the new text afterwards using desired properties. This will then not be under control of the redaction logic. You can also choose any of the text insertion variants insert_text, insert_textbox, fill_textbox, insert_htmlbox

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by Muhammadraafat1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
not a bug not a bug / user error / unable to reproduce
2 participants
Converted from issue

This discussion was converted from issue #3509 on May 23, 2024 12:46.