java.lang.Objectcom.aspose.words.RevisionOptions
public class RevisionOptions
Example:
Document doc = new Document();
LayoutOptions options = doc.getLayoutOptions();
// The appearance of revisions can be controlled from the layout options property
doc.startTrackRevisions("John Doe", new Date());
options.getRevisionOptions().setInsertedTextColor(RevisionColor.BRIGHT_GREEN);
options.getRevisionOptions().setShowRevisionBars(false);
DocumentBuilder builder = new DocumentBuilder(doc);
builder.writeln(
"This is a revision. Normally the text is red with a bar to the left, but we made some changes to the revision options.");
doc.stopTrackRevisions();
// Layout options can be used to show hidden text too
builder.writeln("This text is not hidden.");
builder.getFont().setHidden(true);
builder.writeln(
"This text is hidden. It will only show up in the output if we allow it to via doc.LayoutOptions.");
options.setShowHiddenText(true);
// This option is equivalent to enabling paragraph marks in Microsoft Word via Home > paragraph > Show Paragraph Marks,
// and can be used to display these features in a .pdf
options.setShowParagraphMarks(true);
doc.save(getArtifactsDir() + "Document.LayoutOptions.pdf");
Property Getters/Setters Summary | ||
---|---|---|
int | getCommentColor() | |
void | setCommentColor(int value) | |
Allows to specify the color to be used for comments.
Default value for this property is |
||
int | getDeletedTextColor() | |
void | setDeletedTextColor(int value) | |
Allows to specify the color to be used for deleted content |
||
int | getDeletedTextEffect() | |
void | setDeletedTextEffect(int value) | |
Allows to specify the effect to be applied to the deleted content |
||
int | getInsertedTextColor() | |
void | setInsertedTextColor(int value) | |
Allows to specify the color to be used for inserted content |
||
int | getInsertedTextEffect() | |
void | setInsertedTextEffect(int value) | |
Allows to specify the effect to be applied to the inserted content |
||
int | getMovedFromTextColor() | |
void | setMovedFromTextColor(int value) | |
Allows to specify the color to be used for areas where content was moved from |
||
int | getMovedFromTextEffect() | |
void | setMovedFromTextEffect(int value) | |
Allows to specify the effect to be applied to the areas where content was moved from |
||
int | getMovedToTextColor() | |
void | setMovedToTextColor(int value) | |
Allows to specify the color to be used for areas where content was moved to |
||
int | getMovedToTextEffect() | |
void | setMovedToTextEffect(int value) | |
Allows to specify the effect to be applied to the areas where content was moved to |
||
int | getRevisedPropertiesColor() | |
void | setRevisedPropertiesColor(int value) | |
Allows to specify the color to be used for content with changes of formatting properties |
||
int | getRevisedPropertiesEffect() | |
void | setRevisedPropertiesEffect(int value) | |
Allows to specify the effect for content areas with changes of formatting properties |
||
int | getRevisionBarsColor() | |
void | setRevisionBarsColor(int value) | |
Allows to specify the color to be used for side bars that identify document lines containing revised information.
Default value for this property is |
||
float | getRevisionBarsWidth() | |
void | setRevisionBarsWidth(float value) | |
Gets or sets width of revision bars, points. | ||
int | getShowInBalloons() | |
void | setShowInBalloons(int value) | |
Allows to specify whether the revisions are rendered in the balloons.
Default value for this property is |
||
boolean | getShowOriginalRevision() | |
void | setShowOriginalRevision(boolean value) | |
Allows to specify whether the original text should be shown instead of revised one.
Default value for this property is false .
|
||
boolean | getShowRevisionBars() | |
void | setShowRevisionBars(boolean value) | |
Allows to specify whether revision bars should be rendered near lines containing revised content.
Default value for this property is true .
|
||
boolean | getShowRevisionMarks() | |
void | setShowRevisionMarks(boolean value) | |
Allow to specify whether revision text should be marked with special formatting markup.
Default value for this property is true .
|
Property Getters/Setters Detail |
---|
getCommentColor/setCommentColor | |
public int getCommentColor() / public void setCommentColor(int value) |
Example:
Shows how to edit 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 text inserted while revisions were being tracked in italic green revisionOptions.setInsertedTextColor(RevisionColor.GREEN); revisionOptions.setInsertedTextEffect(RevisionTextEffect.ITALIC); // Render text deleted while revisions were being tracked in bold red revisionOptions.setDeletedTextColor(RevisionColor.RED); revisionOptions.setDeletedTextEffect(RevisionTextEffect.BOLD); // In a movement revision, the same text will appear twice: once at the departure point and once at the arrival destination // Render the text at the moved-from revision yellow with 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.BLUE); revisionOptions.setMovedFromTextEffect(RevisionTextEffect.DOUBLE_UNDERLINE); // Render text which had its format changed while revisions were being tracked in bold dark red 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() + "Document.RevisionOptions.pdf");
getDeletedTextColor/setDeletedTextColor | |
public int getDeletedTextColor() / public void setDeletedTextColor(int value) |
Example:
Shows how to edit 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 text inserted while revisions were being tracked in italic green revisionOptions.setInsertedTextColor(RevisionColor.GREEN); revisionOptions.setInsertedTextEffect(RevisionTextEffect.ITALIC); // Render text deleted while revisions were being tracked in bold red revisionOptions.setDeletedTextColor(RevisionColor.RED); revisionOptions.setDeletedTextEffect(RevisionTextEffect.BOLD); // In a movement revision, the same text will appear twice: once at the departure point and once at the arrival destination // Render the text at the moved-from revision yellow with 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.BLUE); revisionOptions.setMovedFromTextEffect(RevisionTextEffect.DOUBLE_UNDERLINE); // Render text which had its format changed while revisions were being tracked in bold dark red 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() + "Document.RevisionOptions.pdf");
getDeletedTextEffect/setDeletedTextEffect | |
public int getDeletedTextEffect() / public void setDeletedTextEffect(int value) |
Example:
Shows how to edit 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 text inserted while revisions were being tracked in italic green revisionOptions.setInsertedTextColor(RevisionColor.GREEN); revisionOptions.setInsertedTextEffect(RevisionTextEffect.ITALIC); // Render text deleted while revisions were being tracked in bold red revisionOptions.setDeletedTextColor(RevisionColor.RED); revisionOptions.setDeletedTextEffect(RevisionTextEffect.BOLD); // In a movement revision, the same text will appear twice: once at the departure point and once at the arrival destination // Render the text at the moved-from revision yellow with 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.BLUE); revisionOptions.setMovedFromTextEffect(RevisionTextEffect.DOUBLE_UNDERLINE); // Render text which had its format changed while revisions were being tracked in bold dark red 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() + "Document.RevisionOptions.pdf");
getInsertedTextColor/setInsertedTextColor | |
public int getInsertedTextColor() / public void setInsertedTextColor(int value) |
Example:
Shows how to set a document's layout options.Document doc = new Document(); LayoutOptions options = doc.getLayoutOptions(); // The appearance of revisions can be controlled from the layout options property doc.startTrackRevisions("John Doe", new Date()); options.getRevisionOptions().setInsertedTextColor(RevisionColor.BRIGHT_GREEN); options.getRevisionOptions().setShowRevisionBars(false); DocumentBuilder builder = new DocumentBuilder(doc); builder.writeln( "This is a revision. Normally the text is red with a bar to the left, but we made some changes to the revision options."); doc.stopTrackRevisions(); // Layout options can be used to show hidden text too builder.writeln("This text is not hidden."); builder.getFont().setHidden(true); builder.writeln( "This text is hidden. It will only show up in the output if we allow it to via doc.LayoutOptions."); options.setShowHiddenText(true); // This option is equivalent to enabling paragraph marks in Microsoft Word via Home > paragraph > Show Paragraph Marks, // and can be used to display these features in a .pdf options.setShowParagraphMarks(true); doc.save(getArtifactsDir() + "Document.LayoutOptions.pdf");
getInsertedTextEffect/setInsertedTextEffect | |
public int getInsertedTextEffect() / public void setInsertedTextEffect(int value) |
Example:
Shows how to edit 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 text inserted while revisions were being tracked in italic green revisionOptions.setInsertedTextColor(RevisionColor.GREEN); revisionOptions.setInsertedTextEffect(RevisionTextEffect.ITALIC); // Render text deleted while revisions were being tracked in bold red revisionOptions.setDeletedTextColor(RevisionColor.RED); revisionOptions.setDeletedTextEffect(RevisionTextEffect.BOLD); // In a movement revision, the same text will appear twice: once at the departure point and once at the arrival destination // Render the text at the moved-from revision yellow with 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.BLUE); revisionOptions.setMovedFromTextEffect(RevisionTextEffect.DOUBLE_UNDERLINE); // Render text which had its format changed while revisions were being tracked in bold dark red 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() + "Document.RevisionOptions.pdf");
getMovedFromTextColor/setMovedFromTextColor | |
public int getMovedFromTextColor() / public void setMovedFromTextColor(int value) |
Example:
Shows how to edit 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 text inserted while revisions were being tracked in italic green revisionOptions.setInsertedTextColor(RevisionColor.GREEN); revisionOptions.setInsertedTextEffect(RevisionTextEffect.ITALIC); // Render text deleted while revisions were being tracked in bold red revisionOptions.setDeletedTextColor(RevisionColor.RED); revisionOptions.setDeletedTextEffect(RevisionTextEffect.BOLD); // In a movement revision, the same text will appear twice: once at the departure point and once at the arrival destination // Render the text at the moved-from revision yellow with 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.BLUE); revisionOptions.setMovedFromTextEffect(RevisionTextEffect.DOUBLE_UNDERLINE); // Render text which had its format changed while revisions were being tracked in bold dark red 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() + "Document.RevisionOptions.pdf");
getMovedFromTextEffect/setMovedFromTextEffect | |
public int getMovedFromTextEffect() / public void setMovedFromTextEffect(int value) |
Example:
Shows how to edit 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 text inserted while revisions were being tracked in italic green revisionOptions.setInsertedTextColor(RevisionColor.GREEN); revisionOptions.setInsertedTextEffect(RevisionTextEffect.ITALIC); // Render text deleted while revisions were being tracked in bold red revisionOptions.setDeletedTextColor(RevisionColor.RED); revisionOptions.setDeletedTextEffect(RevisionTextEffect.BOLD); // In a movement revision, the same text will appear twice: once at the departure point and once at the arrival destination // Render the text at the moved-from revision yellow with 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.BLUE); revisionOptions.setMovedFromTextEffect(RevisionTextEffect.DOUBLE_UNDERLINE); // Render text which had its format changed while revisions were being tracked in bold dark red 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() + "Document.RevisionOptions.pdf");
getMovedToTextColor/setMovedToTextColor | |
public int getMovedToTextColor() / public void setMovedToTextColor(int value) |
Example:
Shows how to edit 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 text inserted while revisions were being tracked in italic green revisionOptions.setInsertedTextColor(RevisionColor.GREEN); revisionOptions.setInsertedTextEffect(RevisionTextEffect.ITALIC); // Render text deleted while revisions were being tracked in bold red revisionOptions.setDeletedTextColor(RevisionColor.RED); revisionOptions.setDeletedTextEffect(RevisionTextEffect.BOLD); // In a movement revision, the same text will appear twice: once at the departure point and once at the arrival destination // Render the text at the moved-from revision yellow with 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.BLUE); revisionOptions.setMovedFromTextEffect(RevisionTextEffect.DOUBLE_UNDERLINE); // Render text which had its format changed while revisions were being tracked in bold dark red 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() + "Document.RevisionOptions.pdf");
getMovedToTextEffect/setMovedToTextEffect | |
public int getMovedToTextEffect() / public void setMovedToTextEffect(int value) |
Example:
Shows how to edit 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 text inserted while revisions were being tracked in italic green revisionOptions.setInsertedTextColor(RevisionColor.GREEN); revisionOptions.setInsertedTextEffect(RevisionTextEffect.ITALIC); // Render text deleted while revisions were being tracked in bold red revisionOptions.setDeletedTextColor(RevisionColor.RED); revisionOptions.setDeletedTextEffect(RevisionTextEffect.BOLD); // In a movement revision, the same text will appear twice: once at the departure point and once at the arrival destination // Render the text at the moved-from revision yellow with 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.BLUE); revisionOptions.setMovedFromTextEffect(RevisionTextEffect.DOUBLE_UNDERLINE); // Render text which had its format changed while revisions were being tracked in bold dark red 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() + "Document.RevisionOptions.pdf");
getRevisedPropertiesColor/setRevisedPropertiesColor | |
public int getRevisedPropertiesColor() / public void setRevisedPropertiesColor(int value) |
Example:
Shows how to edit 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 text inserted while revisions were being tracked in italic green revisionOptions.setInsertedTextColor(RevisionColor.GREEN); revisionOptions.setInsertedTextEffect(RevisionTextEffect.ITALIC); // Render text deleted while revisions were being tracked in bold red revisionOptions.setDeletedTextColor(RevisionColor.RED); revisionOptions.setDeletedTextEffect(RevisionTextEffect.BOLD); // In a movement revision, the same text will appear twice: once at the departure point and once at the arrival destination // Render the text at the moved-from revision yellow with 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.BLUE); revisionOptions.setMovedFromTextEffect(RevisionTextEffect.DOUBLE_UNDERLINE); // Render text which had its format changed while revisions were being tracked in bold dark red 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() + "Document.RevisionOptions.pdf");
getRevisedPropertiesEffect/setRevisedPropertiesEffect | |
public int getRevisedPropertiesEffect() / public void setRevisedPropertiesEffect(int value) |
Example:
Shows how to edit 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 text inserted while revisions were being tracked in italic green revisionOptions.setInsertedTextColor(RevisionColor.GREEN); revisionOptions.setInsertedTextEffect(RevisionTextEffect.ITALIC); // Render text deleted while revisions were being tracked in bold red revisionOptions.setDeletedTextColor(RevisionColor.RED); revisionOptions.setDeletedTextEffect(RevisionTextEffect.BOLD); // In a movement revision, the same text will appear twice: once at the departure point and once at the arrival destination // Render the text at the moved-from revision yellow with 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.BLUE); revisionOptions.setMovedFromTextEffect(RevisionTextEffect.DOUBLE_UNDERLINE); // Render text which had its format changed while revisions were being tracked in bold dark red 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() + "Document.RevisionOptions.pdf");
getRevisionBarsColor/setRevisionBarsColor | |
public int getRevisionBarsColor() / public void setRevisionBarsColor(int value) |
Example:
Shows how to edit 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 text inserted while revisions were being tracked in italic green revisionOptions.setInsertedTextColor(RevisionColor.GREEN); revisionOptions.setInsertedTextEffect(RevisionTextEffect.ITALIC); // Render text deleted while revisions were being tracked in bold red revisionOptions.setDeletedTextColor(RevisionColor.RED); revisionOptions.setDeletedTextEffect(RevisionTextEffect.BOLD); // In a movement revision, the same text will appear twice: once at the departure point and once at the arrival destination // Render the text at the moved-from revision yellow with 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.BLUE); revisionOptions.setMovedFromTextEffect(RevisionTextEffect.DOUBLE_UNDERLINE); // Render text which had its format changed while revisions were being tracked in bold dark red 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() + "Document.RevisionOptions.pdf");
getRevisionBarsWidth/setRevisionBarsWidth | |
public float getRevisionBarsWidth() / public void setRevisionBarsWidth(float value) |
Example:
Shows how to edit 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 text inserted while revisions were being tracked in italic green revisionOptions.setInsertedTextColor(RevisionColor.GREEN); revisionOptions.setInsertedTextEffect(RevisionTextEffect.ITALIC); // Render text deleted while revisions were being tracked in bold red revisionOptions.setDeletedTextColor(RevisionColor.RED); revisionOptions.setDeletedTextEffect(RevisionTextEffect.BOLD); // In a movement revision, the same text will appear twice: once at the departure point and once at the arrival destination // Render the text at the moved-from revision yellow with 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.BLUE); revisionOptions.setMovedFromTextEffect(RevisionTextEffect.DOUBLE_UNDERLINE); // Render text which had its format changed while revisions were being tracked in bold dark red 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() + "Document.RevisionOptions.pdf");
getShowInBalloons/setShowInBalloons | |
public int getShowInBalloons() / public void setShowInBalloons(int value) |
Example:
Shows how render tracking changes in balloons.Document doc = new Document(getMyDir() + "Revisions.docx"); // Set option true, if you need render tracking changes in balloons in pdf document, // while comments will stay visible doc.getLayoutOptions().getRevisionOptions().setShowInBalloons(ShowInBalloons.NONE); // Check that revisions are in balloons doc.save(getArtifactsDir() + "Document.ShowRevisionBalloons.pdf");
Example:
Shows how to edit 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 text inserted while revisions were being tracked in italic green revisionOptions.setInsertedTextColor(RevisionColor.GREEN); revisionOptions.setInsertedTextEffect(RevisionTextEffect.ITALIC); // Render text deleted while revisions were being tracked in bold red revisionOptions.setDeletedTextColor(RevisionColor.RED); revisionOptions.setDeletedTextEffect(RevisionTextEffect.BOLD); // In a movement revision, the same text will appear twice: once at the departure point and once at the arrival destination // Render the text at the moved-from revision yellow with 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.BLUE); revisionOptions.setMovedFromTextEffect(RevisionTextEffect.DOUBLE_UNDERLINE); // Render text which had its format changed while revisions were being tracked in bold dark red 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() + "Document.RevisionOptions.pdf");
getShowOriginalRevision/setShowOriginalRevision | |
public boolean getShowOriginalRevision() / public void setShowOriginalRevision(boolean value) |
false
.
Example:
Shows how to edit 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 text inserted while revisions were being tracked in italic green revisionOptions.setInsertedTextColor(RevisionColor.GREEN); revisionOptions.setInsertedTextEffect(RevisionTextEffect.ITALIC); // Render text deleted while revisions were being tracked in bold red revisionOptions.setDeletedTextColor(RevisionColor.RED); revisionOptions.setDeletedTextEffect(RevisionTextEffect.BOLD); // In a movement revision, the same text will appear twice: once at the departure point and once at the arrival destination // Render the text at the moved-from revision yellow with 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.BLUE); revisionOptions.setMovedFromTextEffect(RevisionTextEffect.DOUBLE_UNDERLINE); // Render text which had its format changed while revisions were being tracked in bold dark red 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() + "Document.RevisionOptions.pdf");
getShowRevisionBars/setShowRevisionBars | |
public boolean getShowRevisionBars() / public void setShowRevisionBars(boolean value) |
true
.
Example:
Shows how to set a document's layout options.Document doc = new Document(); LayoutOptions options = doc.getLayoutOptions(); // The appearance of revisions can be controlled from the layout options property doc.startTrackRevisions("John Doe", new Date()); options.getRevisionOptions().setInsertedTextColor(RevisionColor.BRIGHT_GREEN); options.getRevisionOptions().setShowRevisionBars(false); DocumentBuilder builder = new DocumentBuilder(doc); builder.writeln( "This is a revision. Normally the text is red with a bar to the left, but we made some changes to the revision options."); doc.stopTrackRevisions(); // Layout options can be used to show hidden text too builder.writeln("This text is not hidden."); builder.getFont().setHidden(true); builder.writeln( "This text is hidden. It will only show up in the output if we allow it to via doc.LayoutOptions."); options.setShowHiddenText(true); // This option is equivalent to enabling paragraph marks in Microsoft Word via Home > paragraph > Show Paragraph Marks, // and can be used to display these features in a .pdf options.setShowParagraphMarks(true); doc.save(getArtifactsDir() + "Document.LayoutOptions.pdf");
getShowRevisionMarks/setShowRevisionMarks | |
public boolean getShowRevisionMarks() / public void setShowRevisionMarks(boolean value) |
true
.
Example:
Shows how to edit 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 text inserted while revisions were being tracked in italic green revisionOptions.setInsertedTextColor(RevisionColor.GREEN); revisionOptions.setInsertedTextEffect(RevisionTextEffect.ITALIC); // Render text deleted while revisions were being tracked in bold red revisionOptions.setDeletedTextColor(RevisionColor.RED); revisionOptions.setDeletedTextEffect(RevisionTextEffect.BOLD); // In a movement revision, the same text will appear twice: once at the departure point and once at the arrival destination // Render the text at the moved-from revision yellow with 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.BLUE); revisionOptions.setMovedFromTextEffect(RevisionTextEffect.DOUBLE_UNDERLINE); // Render text which had its format changed while revisions were being tracked in bold dark red 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() + "Document.RevisionOptions.pdf");