title: The error in highlighting function using fitz package & python code
body: <p>I have a pdf text highlighting problem, here i'm using <em>fitz</em> for highlighting the specific text.<br />
  But when I run the system display I get a &quot;segmentation fault&quot; and the highlighted pdf not being saved.
  Here I attached the code.</p>
  <pre><code>import fitz
  
  input1 = &quot;abc.pdf&quot;
  input2 = &quot;xyz.pdf&quot;
  
  #Strikethrough
  doc = fitz.open(input1)
  length = len(doc)
  
  for text in changed_lines_set:
      for i in range(length):
          page = doc[i]
          text_instances = page.searchFor(text)
          highlight = page.addUnderlineAnnot(text_instances)
          highlight.setColors({&quot;stroke&quot;:(0, 0, 1), &quot;fill&quot;:(0.75, 0.8, 0.95)})
          highlight.update()
          # print(highlight)
  doc.save(&quot;output_file1.pdf&quot;)
  
  # Highlighting
  doc = fitz.open(input2)
  length = len(doc)
  for text in deleted_lines_set:
      for i in range(length):
          page = doc[i]
          text_instances = page.searchFor(text)
          highlight = page.addHighlightAnnot(text_instances)
          highlight.setColors({&quot;stroke&quot;:(0.5, 1, 1), &quot;fill&quot;:(0.75, 0.8, 0.95)})
          highlight.update()
  doc.save(&quot;output_file2.pdf&quot;)
  </code></pre>
  <p>I got an error hint line: <code>highlight.update()</code></p>
  <p>How to solve this issue.<br />
  Thanks in advance</p>