Strike Out Words using StrikeOutAnnotation
Contents
[
Hide
]Aspose.PDF for Java allows you to add, delete and update annotations in PDF documents. One of the classes allows you to strike out annotations too. This is useful when you want to strike out one or more text fragments in a document.
Annotations are held in a Page object’s AnnotationCollection collection. A class named StrikeOutAnnotation can be used to add strike out annotations to a PDF document.
To strike out a certain TextFragment:
- Search for a TextFragment in the PDF file.
- Get the TextFragment object’s coordinates.
- Use the coordinates to instantiate a StrikeOutAnnotation object.
The following code snippet shows how to search for a particular TextFragment and add a StrikeOutAnnotation to that object.
A TextFragment may contain one or more segments, so work with internal segments to.