Strike Through Text in PDF with Python REST API

Python PDF developers can easily add a strike‑through annotation to any PDF document using Aspose PDF Cloud’s low‑code REST API. This guide walks you through the required setup, shows how to configure the annotation parameters, and demonstrates the complete workflow—from uploading the source PDF file to downloading the updated document—using the official Python SDK. For more details on the PDF format, see the PDF file info page.

Prerequisite

Steps to Strike Out in Adobe PDF with Python REST Interface

  1. Configure the PdfApi class object by setting the API key and application SID for striking out text
  2. Create the StrikeOutAnnotation object and set the rectangle around the text and color of strike out
  3. Set the modification and creation date of the annotation as it is must require
  4. Upload the target PDF file to Cloud storage for striking through text
  5. Call the PostPageStrikeOutAnnotations() method to strikeout text with custom settings
  6. Download the updated PDF file with strike‑through text

These steps define how to strike out text in PDF with Python REST API. Create an object of the PdfApi class, and instantiate the StrikeOutAnnotation object by setting the rectangle around the target text, color, creation date, and modification date. Upload the target PDF file to the Cloud storage and call the PostPageStrikeOutAnnotations() method to accomplish the task.

Code to Strike Through in PDF with Python‑based API

This snippet demonstrates how to strike out text in a PDF using the Python REST interface. You can set annotation properties such as page index, ZIndex, horizontal and vertical alignment, name, subject, and title. Add as many annotations as needed to the list and invoke PostPageStrikeOutAnnotations() to apply them all.

If you need to replace text in a PDF file, see the article on Replace text in PDF with Python REST API.

Keywords: how to strike through text in pdf with Python Low Code API; how to strikeout in pdf with Python REST Interface; strike out text in pdf with Python RESTful Service; strike through in pdf with Python-based API; strike through text in pdf with Python REST API; strike through text on pdf with Python Low Code API.