PDF Editing Issues

How to Fix PDF Annotations Disappearing After Moving

Phi Hung VoPhi Hung Vo Nov 10, 2026 869 views

Question details

The user needs to prevent PDF annotations from losing their text and color properties when they are moved or edited.

How to Prevent PDF Annotations from Disappearing After Moving
Product
PDF
Device & OS
not provided
Scenario
Modifying or repositioning PDF annotations that were generated programmatically, such as with the Python pdf-annotate library.
Observed behavior
The annotation content, including text and colors, disappears completely, leaving only an empty text box visible.
Before you start

Before modifying your Python scripts or testing new PDF viewers, ensure you have saved a backup copy of your original PDF document to prevent permanent data loss during troubleshooting.

Solution 1Recommended

Isolate the Library Issue and Update Annotation Handling

Determine if the disappearance is caused by the PDF viewer or the Python library's serialization, and apply the necessary fixes to the appearance stream.

When PDF annotations lose their visual content upon being moved, the root cause is typically a missing or improperly formatted Appearance Stream (/AP dictionary). Without this, the PDF viewer does not know how to re-render the annotation in its new location.

1
Test with a standard PDF editor

Open the problematic PDF in a standard application like Adobe Acrobat or WPS Office. Manually create the same type of annotation, then move it. If it moves correctly without disappearing, the issue lies specifically within the script or library used to generate the original PDF.

2
Review the library issue tracker

Visit the GitHub repository or official documentation for the Python pdf-annotate library. Search the issues tab for 'disappearing text' or 'appearance stream' to see if a patch or workaround has already been documented by other users.

3
Update appearance-handling code

Modify your Python script to ensure it correctly generates and serializes the appearance stream alongside the annotation metadata. Both the /Contents key and the /AP (Appearance) dictionary must be properly defined so viewers can render the moved object.

4
Switch to a supported annotation library

If the current library cannot properly preserve annotation appearances, migrate your project to a more robust, actively maintained library (such as PyMuPDF) that fully complies with PDF specifications and preserves metadata during edits.

Isolate the Library Issue and Update Annotation Handling
Understanding Appearance Streams: PDF specification requires annotations to have an appearance stream to dictate exactly how they look. If a script only adds text to the data dictionary but skips the appearance stream, viewers will often discard the visual content the moment the object is manipulated.
Reliable PDF Editor

Edit and Manage PDF Annotations Seamlessly with WPS Office

Instead of struggling with buggy scripts or missing appearance streams, use WPS Office's built-in PDF editor to manage your documents. WPS Office natively handles all standard PDF specifications, ensuring that annotations, text boxes, and highlights retain their appearance, text, and formatting regardless of where they are moved on the page.

  1. 1. Open your PDF document: Launch WPS Office and open the PDF file containing the annotations you want to manage.
  2. 2. Access the Comment tab: Navigate to the 'Comment' tab on the top ribbon to access standard annotation tools like Text Box, Highlight, and Shapes.
  3. 3. Add or move annotations securely: Click to select any existing annotation and drag it to your desired location. WPS Office will automatically update the appearance stream, keeping text and colors perfectly intact.
  4. 4. Save your document: Click 'Save' to preserve your changes with full cross-platform compatibility.
Preserves all annotation properties and text formats securelyHighly compatible with standard PDF annotations and Adobe Acrobat filesIntuitive drag-and-drop interface for moving document elements safelyFeature-rich, lightweight, and free alternative for PDF editing
QA img-9

Frequently Asked Questions

Why do PDF annotations sometimes turn into empty boxes when moved?

This usually happens because the annotation's appearance stream (the visual representation data) was not properly generated by the software or script that created it. When you move the annotation, the PDF viewer tries to re-render it but fails due to the missing visual data, leaving only the bounding box.

How can I recover the text from a disappeared PDF annotation?

If only the visual appearance is lost, the text metadata might still exist in the PDF's underlying dictionary. You can often recover it by opening the PDF in a robust editor like WPS Office, right-clicking the annotation to view its properties, and checking the text contents.

Are annotations created in Python compatible with standard PDF viewers?

Yes, provided the Python library correctly follows the official PDF specification. It must generate the required /AP (Appearance) streams. If a library skips this step, standard viewers might display the annotations inconsistently or break them when edited.