public class RevisionOptions
extends java.lang.Object
implements java.lang.Cloneable
To learn more, visit the Converting to Fixed-page Format documentation article.
Examples:
Shows how to alter the appearance of revisions in a rendered output document.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
// Insert a revision, then change the color of all revisions to green.
builder.writeln("This is not a revision.");
doc.startTrackRevisions("John Doe", new Date());
builder.writeln("This is a revision.");
doc.stopTrackRevisions();
builder.writeln("This is not a revision.");
// Remove the bar that appears to the left of every revised line.
doc.getLayoutOptions().getRevisionOptions().setInsertedTextColor(RevisionColor.BRIGHT_GREEN);
doc.getLayoutOptions().getRevisionOptions().setShowRevisionBars(false);
doc.getLayoutOptions().getRevisionOptions().setRevisionBarsPosition(HorizontalAlignment.RIGHT);
doc.save(getArtifactsDir() + "Revision.LayoutOptionsRevisions.pdf");
| Modifier and Type | Method and Description |
|---|---|
int |
getCommentColor()
Allows to specify the color to be used for comments.
|
int |
getDeleteCellColor()
Allows to specify the color to be used for deleted cells
RevisionType.DELETION. |
int |
getDeletedTextColor()
Allows to specify the color to be used for deleted content
RevisionType.DELETION. |
int |
getDeletedTextEffect()
Allows to specify the effect to be applied to the deleted content
RevisionType.DELETION. |
int |
getInsertCellColor()
Allows to specify the color to be used for inserted cells
RevisionType.INSERTION. |
int |
getInsertedTextColor()
Allows to specify the color to be used for inserted content
RevisionType.INSERTION. |
int |
getInsertedTextEffect()
Allows to specify the effect to be applied to the inserted content
RevisionType.INSERTION. |
int |
getMeasurementUnit()
Allows to specify the measurement units for revision comments.
|
int |
getMovedFromTextColor()
Allows to specify the color to be used for areas where content was moved from
RevisionType.MOVING. |
int |
getMovedFromTextEffect()
Allows to specify the effect to be applied to the areas where content was moved from
RevisionType.MOVING. |
int |
getMovedToTextColor()
Allows to specify the color to be used for areas where content was moved to
RevisionType.MOVING. |
int |
getMovedToTextEffect()
Allows to specify the effect to be applied to the areas where content was moved to
RevisionType.MOVING. |
int |
getRevisedPropertiesColor()
Allows to specify the color to be used for content with changes of formatting properties
RevisionType.FORMAT_CHANGE Default value is RevisionColor.NO_HIGHLIGHT. |
int |
getRevisedPropertiesEffect()
Allows to specify the effect for content areas with changes of formatting properties
RevisionType.FORMAT_CHANGE Default value is RevisionTextEffect.NONE |
int |
getRevisionBarsColor()
Allows to specify the color to be used for side bars that identify document lines containing revised information.
|
int |
getRevisionBarsPosition()
Gets rendering position of revision bars.
|
float |
getRevisionBarsWidth()
Gets width of revision bars, points.
|
int |
getShowInBalloons()
Allows to specify whether the revisions are rendered in the balloons.
|
boolean |
getShowOriginalRevision()
Allows to specify whether the original text should be shown instead of revised one.
|
boolean |
getShowRevisionBars()
Allows to specify whether revision bars should be rendered near lines containing revised content.
|
boolean |
getShowRevisionMarks()
Allow to specify whether revision text should be marked with special formatting markup.
|
protected java.lang.Object |
memberwiseClone() |
void |
setCommentColor(int value)
Allows to specify the color to be used for comments.
|
void |
setDeleteCellColor(int value)
Allows to specify the color to be used for deleted cells
RevisionType.DELETION. |
void |
setDeletedTextColor(int value)
Allows to specify the color to be used for deleted content
RevisionType.DELETION. |
void |
setDeletedTextEffect(int value)
Allows to specify the effect to be applied to the deleted content
RevisionType.DELETION. |
void |
setInsertCellColor(int value)
Allows to specify the color to be used for inserted cells
RevisionType.INSERTION. |
void |
setInsertedTextColor(int value)
Allows to specify the color to be used for inserted content
RevisionType.INSERTION. |
void |
setInsertedTextEffect(int value)
Allows to specify the effect to be applied to the inserted content
RevisionType.INSERTION. |
void |
setMeasurementUnit(int value)
Allows to specify the measurement units for revision comments.
|
void |
setMovedFromTextColor(int value)
Allows to specify the color to be used for areas where content was moved from
RevisionType.MOVING. |
void |
setMovedFromTextEffect(int value)
Allows to specify the effect to be applied to the areas where content was moved from
RevisionType.MOVING. |
void |
setMovedToTextColor(int value)
Allows to specify the color to be used for areas where content was moved to
RevisionType.MOVING. |
void |
setMovedToTextEffect(int value)
Allows to specify the effect to be applied to the areas where content was moved to
RevisionType.MOVING. |
void |
setRevisedPropertiesColor(int value)
Allows to specify the color to be used for content with changes of formatting properties
RevisionType.FORMAT_CHANGE Default value is RevisionColor.NO_HIGHLIGHT. |
void |
setRevisedPropertiesEffect(int value)
Allows to specify the effect for content areas with changes of formatting properties
RevisionType.FORMAT_CHANGE Default value is RevisionTextEffect.NONE |
void |
setRevisionBarsColor(int value)
Allows to specify the color to be used for side bars that identify document lines containing revised information.
|
void |
setRevisionBarsPosition(int value)
Sets rendering position of revision bars.
|
void |
setRevisionBarsWidth(float value)
Sets width of revision bars, points.
|
void |
setShowInBalloons(int value)
Allows to specify whether the revisions are rendered in the balloons.
|
void |
setShowOriginalRevision(boolean value)
Allows to specify whether the original text should be shown instead of revised one.
|
void |
setShowRevisionBars(boolean value)
Allows to specify whether revision bars should be rendered near lines containing revised content.
|
void |
setShowRevisionMarks(boolean value)
Allow to specify whether revision text should be marked with special formatting markup.
|
public boolean getShowRevisionMarks()
true.
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");
boolean value.public void setShowRevisionMarks(boolean value)
true.
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");
value - The corresponding boolean value.public boolean getShowRevisionBars()
true.
Examples:
Shows how to alter the appearance of revisions in a rendered output document.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
// Insert a revision, then change the color of all revisions to green.
builder.writeln("This is not a revision.");
doc.startTrackRevisions("John Doe", new Date());
builder.writeln("This is a revision.");
doc.stopTrackRevisions();
builder.writeln("This is not a revision.");
// Remove the bar that appears to the left of every revised line.
doc.getLayoutOptions().getRevisionOptions().setInsertedTextColor(RevisionColor.BRIGHT_GREEN);
doc.getLayoutOptions().getRevisionOptions().setShowRevisionBars(false);
doc.getLayoutOptions().getRevisionOptions().setRevisionBarsPosition(HorizontalAlignment.RIGHT);
doc.save(getArtifactsDir() + "Revision.LayoutOptionsRevisions.pdf");
boolean value.public void setShowRevisionBars(boolean value)
true.
Examples:
Shows how to alter the appearance of revisions in a rendered output document.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
// Insert a revision, then change the color of all revisions to green.
builder.writeln("This is not a revision.");
doc.startTrackRevisions("John Doe", new Date());
builder.writeln("This is a revision.");
doc.stopTrackRevisions();
builder.writeln("This is not a revision.");
// Remove the bar that appears to the left of every revised line.
doc.getLayoutOptions().getRevisionOptions().setInsertedTextColor(RevisionColor.BRIGHT_GREEN);
doc.getLayoutOptions().getRevisionOptions().setShowRevisionBars(false);
doc.getLayoutOptions().getRevisionOptions().setRevisionBarsPosition(HorizontalAlignment.RIGHT);
doc.save(getArtifactsDir() + "Revision.LayoutOptionsRevisions.pdf");
value - The corresponding boolean value.public boolean getShowOriginalRevision()
false.
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");
boolean value.public void setShowOriginalRevision(boolean value)
false.
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");
value - The corresponding boolean value.public int getInsertCellColor()
RevisionType.INSERTION. Default value is RevisionColor.BLUE.
Examples:
Shows how to work with insert/delete cell revision color.
Document doc = new Document(getMyDir() + "Cell revisions.docx");
doc.getLayoutOptions().getRevisionOptions().setInsertCellColor(RevisionColor.BLUE);
doc.getLayoutOptions().getRevisionOptions().setDeleteCellColor(RevisionColor.DARK_RED);
doc.save(getArtifactsDir() + "Revision.RevisionCellColor.pdf");
int value. The returned value is one of RevisionColor constants.public void setInsertCellColor(int value)
RevisionType.INSERTION. Default value is RevisionColor.BLUE.
Examples:
Shows how to work with insert/delete cell revision color.
Document doc = new Document(getMyDir() + "Cell revisions.docx");
doc.getLayoutOptions().getRevisionOptions().setInsertCellColor(RevisionColor.BLUE);
doc.getLayoutOptions().getRevisionOptions().setDeleteCellColor(RevisionColor.DARK_RED);
doc.save(getArtifactsDir() + "Revision.RevisionCellColor.pdf");
value - The corresponding int value. The value must be one of RevisionColor constants.public int getDeleteCellColor()
RevisionType.DELETION. Default value is RevisionColor.PINK.
Examples:
Shows how to work with insert/delete cell revision color.
Document doc = new Document(getMyDir() + "Cell revisions.docx");
doc.getLayoutOptions().getRevisionOptions().setInsertCellColor(RevisionColor.BLUE);
doc.getLayoutOptions().getRevisionOptions().setDeleteCellColor(RevisionColor.DARK_RED);
doc.save(getArtifactsDir() + "Revision.RevisionCellColor.pdf");
int value. The returned value is one of RevisionColor constants.public void setDeleteCellColor(int value)
RevisionType.DELETION. Default value is RevisionColor.PINK.
Examples:
Shows how to work with insert/delete cell revision color.
Document doc = new Document(getMyDir() + "Cell revisions.docx");
doc.getLayoutOptions().getRevisionOptions().setInsertCellColor(RevisionColor.BLUE);
doc.getLayoutOptions().getRevisionOptions().setDeleteCellColor(RevisionColor.DARK_RED);
doc.save(getArtifactsDir() + "Revision.RevisionCellColor.pdf");
value - The corresponding int value. The value must be one of RevisionColor constants.public int getInsertedTextColor()
RevisionType.INSERTION. Default value is RevisionColor.BY_AUTHOR.
Examples:
Shows how to alter the appearance of revisions in a rendered output document.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
// Insert a revision, then change the color of all revisions to green.
builder.writeln("This is not a revision.");
doc.startTrackRevisions("John Doe", new Date());
builder.writeln("This is a revision.");
doc.stopTrackRevisions();
builder.writeln("This is not a revision.");
// Remove the bar that appears to the left of every revised line.
doc.getLayoutOptions().getRevisionOptions().setInsertedTextColor(RevisionColor.BRIGHT_GREEN);
doc.getLayoutOptions().getRevisionOptions().setShowRevisionBars(false);
doc.getLayoutOptions().getRevisionOptions().setRevisionBarsPosition(HorizontalAlignment.RIGHT);
doc.save(getArtifactsDir() + "Revision.LayoutOptionsRevisions.pdf");
int value. The returned value is one of RevisionColor constants.public void setInsertedTextColor(int value)
RevisionType.INSERTION. Default value is RevisionColor.BY_AUTHOR.
Examples:
Shows how to alter the appearance of revisions in a rendered output document.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
// Insert a revision, then change the color of all revisions to green.
builder.writeln("This is not a revision.");
doc.startTrackRevisions("John Doe", new Date());
builder.writeln("This is a revision.");
doc.stopTrackRevisions();
builder.writeln("This is not a revision.");
// Remove the bar that appears to the left of every revised line.
doc.getLayoutOptions().getRevisionOptions().setInsertedTextColor(RevisionColor.BRIGHT_GREEN);
doc.getLayoutOptions().getRevisionOptions().setShowRevisionBars(false);
doc.getLayoutOptions().getRevisionOptions().setRevisionBarsPosition(HorizontalAlignment.RIGHT);
doc.save(getArtifactsDir() + "Revision.LayoutOptionsRevisions.pdf");
value - The corresponding int value. The value must be one of RevisionColor constants.public int getInsertedTextEffect()
RevisionType.INSERTION. Default value is RevisionTextEffect.UNDERLINE.int value. The returned value is one of RevisionTextEffect constants.java.lang.IllegalArgumentException - Value of RevisionTextEffect.HIDDEN is not allowed.
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");
public void setInsertedTextEffect(int value)
RevisionType.INSERTION. Default value is RevisionTextEffect.UNDERLINE.value - The corresponding int value. The value must be one of RevisionTextEffect constants.java.lang.IllegalArgumentException - Value of RevisionTextEffect.HIDDEN is not allowed.
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");
public int getDeletedTextColor()
RevisionType.DELETION. Default value is RevisionColor.BY_AUTHOR.
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");
int value. The returned value is one of RevisionColor constants.public void setDeletedTextColor(int value)
RevisionType.DELETION. Default value is RevisionColor.BY_AUTHOR.
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");
value - The corresponding int value. The value must be one of RevisionColor constants.public int getDeletedTextEffect()
RevisionType.DELETION. Default value is RevisionTextEffect.STRIKE_THROUGH
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");
int value. The returned value is one of RevisionTextEffect constants.public void setDeletedTextEffect(int value)
RevisionType.DELETION. Default value is RevisionTextEffect.STRIKE_THROUGH
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");
value - The corresponding int value. The value must be one of RevisionTextEffect constants.public int getMovedFromTextColor()
RevisionType.MOVING. Default value is RevisionColor.BY_AUTHOR.
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");
int value. The returned value is one of RevisionColor constants.public void setMovedFromTextColor(int value)
RevisionType.MOVING. Default value is RevisionColor.BY_AUTHOR.
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");
value - The corresponding int value. The value must be one of RevisionColor constants.public int getMovedFromTextEffect()
RevisionType.MOVING. Default value is RevisionTextEffect.DOUBLE_STRIKE_THROUGH
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");
int value. The returned value is one of RevisionTextEffect constants.public void setMovedFromTextEffect(int value)
RevisionType.MOVING. Default value is RevisionTextEffect.DOUBLE_STRIKE_THROUGH
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");
value - The corresponding int value. The value must be one of RevisionTextEffect constants.public int getMovedToTextColor()
RevisionType.MOVING. Default value is RevisionColor.BY_AUTHOR.
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");
int value. The returned value is one of RevisionColor constants.public void setMovedToTextColor(int value)
RevisionType.MOVING. Default value is RevisionColor.BY_AUTHOR.
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");
value - The corresponding int value. The value must be one of RevisionColor constants.public int getMovedToTextEffect()
RevisionType.MOVING. Default value is RevisionTextEffect.DOUBLE_UNDERLINEint value. The returned value is one of RevisionTextEffect constants.java.lang.IllegalArgumentException - Value of RevisionTextEffect.HIDDEN is not allowed.
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");
public void setMovedToTextEffect(int value)
RevisionType.MOVING. Default value is RevisionTextEffect.DOUBLE_UNDERLINEvalue - The corresponding int value. The value must be one of RevisionTextEffect constants.java.lang.IllegalArgumentException - Value of RevisionTextEffect.HIDDEN is not allowed.
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");
public int getRevisedPropertiesColor()
RevisionType.FORMAT_CHANGE Default value is RevisionColor.NO_HIGHLIGHT.
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");
int value. The returned value is one of RevisionColor constants.public void setRevisedPropertiesColor(int value)
RevisionType.FORMAT_CHANGE Default value is RevisionColor.NO_HIGHLIGHT.
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");
value - The corresponding int value. The value must be one of RevisionColor constants.public int getRevisedPropertiesEffect()
RevisionType.FORMAT_CHANGE Default value is RevisionTextEffect.NONEint value. The returned value is one of RevisionTextEffect constants.java.lang.IllegalArgumentException - RevisionTextEffect.HIDDEN is not allowed.
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");
public void setRevisedPropertiesEffect(int value)
RevisionType.FORMAT_CHANGE Default value is RevisionTextEffect.NONEvalue - The corresponding int value. The value must be one of RevisionTextEffect constants.java.lang.IllegalArgumentException - RevisionTextEffect.HIDDEN is not allowed.
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");
public int getRevisionBarsColor()
RevisionColor.RED.
Remarks:
Setting this property to RevisionColor.BY_AUTHOR or RevisionColor.NO_HIGHLIGHT values will result in hiding revision bars from the layout.
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");
int value. The returned value is one of RevisionColor constants.public void setRevisionBarsColor(int value)
RevisionColor.RED.
Remarks:
Setting this property to RevisionColor.BY_AUTHOR or RevisionColor.NO_HIGHLIGHT values will result in hiding revision bars from the layout.
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");
value - The corresponding int value. The value must be one of RevisionColor constants.public float getRevisionBarsWidth()
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");
public void setRevisionBarsWidth(float value)
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");
value - Width of revision bars, points.public int getRevisionBarsPosition()
HorizontalAlignment.OUTSIDE.HorizontalAlignment constants.java.lang.IllegalArgumentException - Values of HorizontalAlignment.CENTER and HorizontalAlignment.INSIDE are not allowed.
Examples:
Shows how to alter the appearance of revisions in a rendered output document.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
// Insert a revision, then change the color of all revisions to green.
builder.writeln("This is not a revision.");
doc.startTrackRevisions("John Doe", new Date());
builder.writeln("This is a revision.");
doc.stopTrackRevisions();
builder.writeln("This is not a revision.");
// Remove the bar that appears to the left of every revised line.
doc.getLayoutOptions().getRevisionOptions().setInsertedTextColor(RevisionColor.BRIGHT_GREEN);
doc.getLayoutOptions().getRevisionOptions().setShowRevisionBars(false);
doc.getLayoutOptions().getRevisionOptions().setRevisionBarsPosition(HorizontalAlignment.RIGHT);
doc.save(getArtifactsDir() + "Revision.LayoutOptionsRevisions.pdf");
public void setRevisionBarsPosition(int value)
HorizontalAlignment.OUTSIDE.value - Rendering position of revision bars. The value must be one of HorizontalAlignment constants.java.lang.IllegalArgumentException - Values of HorizontalAlignment.CENTER and HorizontalAlignment.INSIDE are not allowed.
Examples:
Shows how to alter the appearance of revisions in a rendered output document.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
// Insert a revision, then change the color of all revisions to green.
builder.writeln("This is not a revision.");
doc.startTrackRevisions("John Doe", new Date());
builder.writeln("This is a revision.");
doc.stopTrackRevisions();
builder.writeln("This is not a revision.");
// Remove the bar that appears to the left of every revised line.
doc.getLayoutOptions().getRevisionOptions().setInsertedTextColor(RevisionColor.BRIGHT_GREEN);
doc.getLayoutOptions().getRevisionOptions().setShowRevisionBars(false);
doc.getLayoutOptions().getRevisionOptions().setRevisionBarsPosition(HorizontalAlignment.RIGHT);
doc.save(getArtifactsDir() + "Revision.LayoutOptionsRevisions.pdf");
public int getCommentColor()
RevisionColor.RED.
Remarks:
If set this property to RevisionColor.BY_AUTHOR or RevisionColor.NO_HIGHLIGHT values, as the result this property will be set to default color.
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");
int value. The returned value is one of RevisionColor constants.public void setCommentColor(int value)
RevisionColor.RED.
Remarks:
If set this property to RevisionColor.BY_AUTHOR or RevisionColor.NO_HIGHLIGHT values, as the result this property will be set to default color.
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");
value - The corresponding int value. The value must be one of RevisionColor constants.public int getShowInBalloons()
ShowInBalloons.NONE.
Remarks:
Note that revisions are not rendered in balloons for CommentDisplayMode.SHOW_IN_ANNOTATIONS.
Examples:
Shows how to display revisions in balloons.
Document doc = new Document(getMyDir() + "Revisions.docx");
// By default, text that is a revision has a different color to differentiate it from the other non-revision text.
// Set a revision option to show more details about each revision in a balloon on the page's right margin.
doc.getLayoutOptions().getRevisionOptions().setShowInBalloons(ShowInBalloons.FORMAT_AND_DELETE);
doc.save(getArtifactsDir() + "Revision.ShowRevisionBalloons.pdf");
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");
int value. The returned value is one of ShowInBalloons constants.public void setShowInBalloons(int value)
ShowInBalloons.NONE.
Remarks:
Note that revisions are not rendered in balloons for CommentDisplayMode.SHOW_IN_ANNOTATIONS.
Examples:
Shows how to display revisions in balloons.
Document doc = new Document(getMyDir() + "Revisions.docx");
// By default, text that is a revision has a different color to differentiate it from the other non-revision text.
// Set a revision option to show more details about each revision in a balloon on the page's right margin.
doc.getLayoutOptions().getRevisionOptions().setShowInBalloons(ShowInBalloons.FORMAT_AND_DELETE);
doc.save(getArtifactsDir() + "Revision.ShowRevisionBalloons.pdf");
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");
value - The corresponding int value. The value must be one of ShowInBalloons constants.public int getMeasurementUnit()
MeasurementUnits.CENTIMETERSint value. The returned value is one of MeasurementUnits constants.public void setMeasurementUnit(int value)
MeasurementUnits.CENTIMETERSvalue - The corresponding int value. The value must be one of MeasurementUnits constants.protected java.lang.Object memberwiseClone()