Python Text annotation with PyMuPDF #873
              
                
                  
                  
                    Answered
                  
                  by
                    JorjMcKie
                  
              
          
                  
                    
                      testingdlrna
                    
                  
                
                  asked this question in
                Q&A
              
            -
Beta Was this translation helpful? Give feedback.
      
      
          Answered by
          
            JorjMcKie
          
      
      
        Feb 1, 2021 
      
    
    Replies: 1 comment
-
| This is a case of text lines which overlap each other in their line height. | 
Beta Was this translation helpful? Give feedback.
                  
                    0 replies
                  
                
            
      Answer selected by
        JorjMcKie
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
        
    

This is a case of text lines which overlap each other in their line height.
When applying redactions, MuPF remove all characters whose bbox has a non-empty overlap with a redaction rectangle.To avoid this, globally set the character bbox height to fontsize height by executing
fitz.TOOLS.set_small_glyph_heights(True)before searching and defining annot rectangles.