public class RevisionTextEffect
extends java.lang.Object
Examples:
Shows how to modify the appearance of revisions.
Document doc = new Document(getMyDir() + "Revisions.docx");
// Get the RevisionOptions object that controls the appearance of revisions.
RevisionOptions revisionOptions = doc.getLayoutOptions().getRevisionOptions();
// Render insertion revisions in green and italic.
revisionOptions.setInsertedTextColor(RevisionColor.GREEN);
revisionOptions.setInsertedTextEffect(RevisionTextEffect.ITALIC);
// Render deletion revisions in red and bold.
revisionOptions.setDeletedTextColor(RevisionColor.RED);
revisionOptions.setDeletedTextEffect(RevisionTextEffect.BOLD);
// The same text will appear twice in a movement revision:
// once at the departure point and once at the arrival destination.
// Render the text at the moved-from revision yellow with a double strike through
// and double-underlined blue at the moved-to revision.
revisionOptions.setMovedFromTextColor(RevisionColor.YELLOW);
revisionOptions.setMovedFromTextEffect(RevisionTextEffect.DOUBLE_STRIKE_THROUGH);
revisionOptions.setMovedToTextColor(RevisionColor.CLASSIC_BLUE);
revisionOptions.setMovedFromTextEffect(RevisionTextEffect.DOUBLE_UNDERLINE);
// Render format revisions in dark red and bold.
revisionOptions.setRevisedPropertiesColor(RevisionColor.DARK_RED);
revisionOptions.setRevisedPropertiesEffect(RevisionTextEffect.BOLD);
// Place a thick dark blue bar on the left side of the page next to lines affected by revisions.
revisionOptions.setRevisionBarsColor(RevisionColor.DARK_BLUE);
revisionOptions.setRevisionBarsWidth(15.0f);
// Show revision marks and original text.
revisionOptions.setShowOriginalRevision(true);
revisionOptions.setShowRevisionMarks(true);
// Get movement, deletion, formatting revisions, and comments to show up in green balloons
// on the right side of the page.
revisionOptions.setShowInBalloons(ShowInBalloons.FORMAT);
revisionOptions.setCommentColor(RevisionColor.BRIGHT_GREEN);
// These features are only applicable to formats such as .pdf or .jpg.
doc.save(getArtifactsDir() + "Revision.RevisionOptions.pdf");
| Modifier and Type | Field and Description |
|---|---|
static int |
BOLD
Revised content is made bold and colored.
|
static int |
COLOR
Revised content is highlighted with color only.
|
static int |
DOUBLE_STRIKE_THROUGH
Revised content is double stroked through and colored.
|
static int |
DOUBLE_UNDERLINE
Revised content is double underlined and colored.
|
static int |
HIDDEN
Revised content is hidden.
|
static int |
ITALIC
Revised content is made italic and colored.
|
static int |
length |
static int |
NONE
Revised content has no special effects applied.
|
static int |
STRIKE_THROUGH
Revised content is stroked through and colored.
|
static int |
UNDERLINE
Revised content is underlined and colored.
|
| Modifier and Type | Method and Description |
|---|---|
static int |
fromName(java.lang.String revisionTextEffectName) |
static java.lang.String |
getName(int revisionTextEffect) |
static int[] |
getValues() |
static java.lang.String |
toString(int revisionTextEffect) |
public static int NONE
RevisionColor.NO_HIGHLIGHT.public static int COLOR
public static int BOLD
public static int ITALIC
public static int UNDERLINE
public static int DOUBLE_UNDERLINE
public static int STRIKE_THROUGH
public static int DOUBLE_STRIKE_THROUGH
Remarks:
Only works for RevisionType.DELETION, RevisionType.FORMAT_CHANGE and RevisionType.MOVING ('move from' type).
public static int HIDDEN
Remarks:
Only works for RevisionType.DELETION and RevisionType.MOVING ('move from' type).
public static int length