RevisionTextEffect
Inheritance: java.lang.Object
public class RevisionTextEffect
Allows to specify decoration effect for revisions of document text.
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");
Fields
Field | Description |
---|---|
BOLD | Revised content is made bold and colored. |
COLOR | Revised content is highlighted with color only. |
DOUBLE_STRIKE_THROUGH | Revised content is double stroked through and colored. |
DOUBLE_UNDERLINE | Revised content is double underlined and colored. |
HIDDEN | Revised content is hidden. |
ITALIC | Revised content is made italic and colored. |
NONE | Revised content has no special effects applied. |
STRIKE_THROUGH | Revised content is stroked through and colored. |
UNDERLINE | Revised content is underlined and colored. |
length |
Methods
Method | Description |
---|---|
fromName(String revisionTextEffectName) | |
getName(int revisionTextEffect) | |
getValues() | |
toString(int revisionTextEffect) |
BOLD
public static int BOLD
Revised content is made bold and colored.
COLOR
public static int COLOR
Revised content is highlighted with color only.
DOUBLE_STRIKE_THROUGH
public static int DOUBLE_STRIKE_THROUGH
Revised content is double stroked through and colored.
Remarks:
Only works for RevisionType.DELETION, RevisionType.FORMAT_CHANGE and RevisionType.MOVING (‘move from’ type).
DOUBLE_UNDERLINE
public static int DOUBLE_UNDERLINE
Revised content is double underlined and colored.
HIDDEN
public static int HIDDEN
Revised content is hidden.
Remarks:
Only works for RevisionType.DELETION and RevisionType.MOVING (‘move from’ type).
ITALIC
public static int ITALIC
Revised content is made italic and colored.
NONE
public static int NONE
Revised content has no special effects applied. This corresponds to RevisionColor.NO_HIGHLIGHT.
STRIKE_THROUGH
public static int STRIKE_THROUGH
Revised content is stroked through and colored.
UNDERLINE
public static int UNDERLINE
Revised content is underlined and colored.
length
public static int length
fromName(String revisionTextEffectName)
public static int fromName(String revisionTextEffectName)
Parameters:
Parameter | Type | Description |
---|---|---|
revisionTextEffectName | java.lang.String |
Returns: int
getName(int revisionTextEffect)
public static String getName(int revisionTextEffect)
Parameters:
Parameter | Type | Description |
---|---|---|
revisionTextEffect | int |
Returns: java.lang.String
getValues()
public static int[] getValues()
Returns: int[]
toString(int revisionTextEffect)
public static String toString(int revisionTextEffect)
Parameters:
Parameter | Type | Description |
---|---|---|
revisionTextEffect | int |
Returns: java.lang.String