Related blog post: Strikethrough Text in Documents using Java
Created
December 24, 2021 13:27
-
-
Save GroupDocsGists/d248b7146303cf285b8b51f6af40549b to your computer and use it in GitHub Desktop.
Strikethrough Text in Documents using Java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Strikethrough Text in Word, PDF, Spreadsheets, Presentations using Java | |
*/ | |
Annotator annotator = new Annotator("path/document.pdf"); | |
StrikeoutAnnotation strikeout = new StrikeoutAnnotation(); | |
strikeout.setFontColor(0xFF0000); | |
strikeout.setOpacity(0.7); | |
strikeout.setPageNumber(0); | |
// Add points for strikeout | |
List<Point> points = new ArrayList<Point>(); | |
points.add(new Point(180, 730)); | |
points.add(new Point(300, 730)); | |
points.add(new Point(180, 700)); | |
points.add(new Point(300, 700)); | |
strikeout.setPoints(points); | |
annotator.add(strikeout); | |
annotator.save("path/strikethrough-text.pdf"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment