com.aspose.words

Class RevisionOptions

  • java.lang.Object
    • com.aspose.words.RevisionOptions
  • All Implemented Interfaces:
    java.lang.Cloneable
    public class RevisionOptions 
    extends java.lang.Object

Allows to control how document revisions are handled during layout process.

Example:

Shows how to set a document's layout options.
Document doc = new Document();

Assert.assertFalse(doc.getLayoutOptions().getShowHiddenText());
Assert.assertFalse(doc.getLayoutOptions().getShowParagraphMarks());

// The appearance of revisions can be controlled from the layout options property
doc.startTrackRevisions("John Doe", new Date());
doc.getLayoutOptions().getRevisionOptions().setInsertedTextColor(RevisionColor.BRIGHT_GREEN);
doc.getLayoutOptions().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.");

doc.getLayoutOptions().setShowHiddenText(true);

doc.save(getArtifactsDir() + "Document.LayoutOptions.pdf");

Property Getters/Setters Summary
intgetCommentColor()
void
setCommentColor(intvalue)
           Allows to specify the color to be used for comments. Default value for this property is RevisionColor.RED. If set this property to RevisionColor.BY_AUTHOR or RevisionColor.NO_HIGHLIGHT values, as the result this property will be set to default color.The value of the property is RevisionColor integer constant.
intgetDeletedTextColor()
void
           Allows to specify the color to be used for deleted content RevisionType.DELETION. Default value for this property is RevisionColor.BY_AUTHOR. The value of the property is RevisionColor integer constant.
intgetDeletedTextEffect()
void
           Allows to specify the effect to be applied to the deleted content RevisionType.DELETION. Default value is RevisionTextEffect.STRIKE_THROUGHThe value of the property is RevisionTextEffect integer constant.
intgetInsertedTextColor()
void
           Allows to specify the color to be used for inserted content RevisionType.INSERTION. Default value for this property is RevisionColor.BY_AUTHOR. The value of the property is RevisionColor integer constant.
intgetInsertedTextEffect()
void
           Allows to specify the effect to be applied to the inserted content RevisionType.INSERTION. Default value is RevisionTextEffect.UNDERLINE. The value of the property is RevisionTextEffect integer constant.
intgetMovedFromTextColor()
void
           Allows to specify the color to be used for areas where content was moved from RevisionType.MOVING. Default value for this property is RevisionColor.BY_AUTHOR. The value of the property is RevisionColor integer constant.
intgetMovedFromTextEffect()
void
           Allows to specify the effect to be applied to the areas where content was moved from RevisionType.MOVING. Default value is RevisionTextEffect.DOUBLE_STRIKE_THROUGHThe value of the property is RevisionTextEffect integer constant.
intgetMovedToTextColor()
void
           Allows to specify the color to be used for areas where content was moved to RevisionType.MOVING. Default value for this property is RevisionColor.BY_AUTHOR. The value of the property is RevisionColor integer constant.
intgetMovedToTextEffect()
void
           Allows to specify the effect to be applied to the areas where content was moved to RevisionType.MOVING. Default value is RevisionTextEffect.DOUBLE_UNDERLINEThe value of the property is RevisionTextEffect integer constant.
intgetRevisedPropertiesColor()
void
           Allows to specify the color to be used for content with changes of formatting properties RevisionType.FORMAT_CHANGE Default value for this property is RevisionColor.NO_HIGHLIGHT. The value of the property is RevisionColor integer constant.
intgetRevisedPropertiesEffect()
void
           Allows to specify the effect for content areas with changes of formatting properties RevisionType.FORMAT_CHANGE Default value is RevisionTextEffect.NONEThe value of the property is RevisionTextEffect integer constant.
intgetRevisionBarsColor()
void
           Allows to specify the color to be used for side bars that identify document lines containing revised information. Default value for this property is RevisionColor.RED. The value of the property is RevisionColor integer constant.
floatgetRevisionBarsWidth()
void
           Gets or sets width of revision bars, points.
intgetShowInBalloons()
void
           Allows to specify whether the revisions are rendered in the balloons. Default value for this property is ShowInBalloons.NONEThe value of the property is ShowInBalloons integer constant.
booleangetShowOriginalRevision()
void
           Allows to specify whether the original text should be shown instead of revised one. Default value for this property is false.
booleangetShowRevisionBars()
void
setShowRevisionBars(booleanvalue)
           Allows to specify whether revision bars should be rendered near lines containing revised content. Default value for this property is true.
booleangetShowRevisionMarks()
void
setShowRevisionMarks(booleanvalue)
           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)
        
        Allows to specify the color to be used for comments. Default value for this property is RevisionColor.RED. If set this property to RevisionColor.BY_AUTHOR or RevisionColor.NO_HIGHLIGHT values, as the result this property will be set to default color.The value of the property is RevisionColor integer constant.

        Example:

        Show how to render revisions in the balloons and edit their appearance.
        Document doc = new Document(getMyDir() + "Document.Revisions.docx");
        
        // Get the RevisionOptions object that controls the appearance of revisions
        RevisionOptions revisionOptions = doc.getLayoutOptions().getRevisionOptions();
        
        // 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);
        
        // 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);
        
        doc.save(getArtifactsDir() + "Document.ShowRevisionsInBalloons.pdf");
      • getDeletedTextColor/setDeletedTextColor

        public int getDeletedTextColor() / public void setDeletedTextColor(int value)
        
        Allows to specify the color to be used for deleted content RevisionType.DELETION. Default value for this property is RevisionColor.BY_AUTHOR. The value of the property is RevisionColor integer constant.

        Example:

        Show how to render revisions in the balloons and edit their appearance.
        Document doc = new Document(getMyDir() + "Document.Revisions.docx");
        
        // Get the RevisionOptions object that controls the appearance of revisions
        RevisionOptions revisionOptions = doc.getLayoutOptions().getRevisionOptions();
        
        // 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);
        
        // 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);
        
        doc.save(getArtifactsDir() + "Document.ShowRevisionsInBalloons.pdf");
      • getDeletedTextEffect/setDeletedTextEffect

        public int getDeletedTextEffect() / public void setDeletedTextEffect(int value)
        
        Allows to specify the effect to be applied to the deleted content RevisionType.DELETION. Default value is RevisionTextEffect.STRIKE_THROUGHThe value of the property is RevisionTextEffect integer constant.

        Example:

        Show how to render revisions in the balloons and edit their appearance.
        Document doc = new Document(getMyDir() + "Document.Revisions.docx");
        
        // Get the RevisionOptions object that controls the appearance of revisions
        RevisionOptions revisionOptions = doc.getLayoutOptions().getRevisionOptions();
        
        // 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);
        
        // 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);
        
        doc.save(getArtifactsDir() + "Document.ShowRevisionsInBalloons.pdf");
      • getInsertedTextColor/setInsertedTextColor

        public int getInsertedTextColor() / public void setInsertedTextColor(int value)
        
        Allows to specify the color to be used for inserted content RevisionType.INSERTION. Default value for this property is RevisionColor.BY_AUTHOR. The value of the property is RevisionColor integer constant.

        Example:

        Shows how to set a document's layout options.
        Document doc = new Document();
        
        Assert.assertFalse(doc.getLayoutOptions().getShowHiddenText());
        Assert.assertFalse(doc.getLayoutOptions().getShowParagraphMarks());
        
        // The appearance of revisions can be controlled from the layout options property
        doc.startTrackRevisions("John Doe", new Date());
        doc.getLayoutOptions().getRevisionOptions().setInsertedTextColor(RevisionColor.BRIGHT_GREEN);
        doc.getLayoutOptions().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.");
        
        doc.getLayoutOptions().setShowHiddenText(true);
        
        doc.save(getArtifactsDir() + "Document.LayoutOptions.pdf");
      • getInsertedTextEffect/setInsertedTextEffect

        public int getInsertedTextEffect() / public void setInsertedTextEffect(int value)
        
        Allows to specify the effect to be applied to the inserted content RevisionType.INSERTION. Default value is RevisionTextEffect.UNDERLINE. The value of the property is RevisionTextEffect integer constant.Values of RevisionTextEffect.HIDDEN and RevisionTextEffect.DOUBLE_STRIKE_THROUGH are not allowed and will cause System.ArgumentOutOfRangeException.

        Example:

        Show how to render revisions in the balloons and edit their appearance.
        Document doc = new Document(getMyDir() + "Document.Revisions.docx");
        
        // Get the RevisionOptions object that controls the appearance of revisions
        RevisionOptions revisionOptions = doc.getLayoutOptions().getRevisionOptions();
        
        // 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);
        
        // 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);
        
        doc.save(getArtifactsDir() + "Document.ShowRevisionsInBalloons.pdf");
      • getMovedFromTextColor/setMovedFromTextColor

        public int getMovedFromTextColor() / public void setMovedFromTextColor(int value)
        
        Allows to specify the color to be used for areas where content was moved from RevisionType.MOVING. Default value for this property is RevisionColor.BY_AUTHOR. The value of the property is RevisionColor integer constant.

        Example:

        Show how to render revisions in the balloons and edit their appearance.
        Document doc = new Document(getMyDir() + "Document.Revisions.docx");
        
        // Get the RevisionOptions object that controls the appearance of revisions
        RevisionOptions revisionOptions = doc.getLayoutOptions().getRevisionOptions();
        
        // 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);
        
        // 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);
        
        doc.save(getArtifactsDir() + "Document.ShowRevisionsInBalloons.pdf");
      • getMovedFromTextEffect/setMovedFromTextEffect

        public int getMovedFromTextEffect() / public void setMovedFromTextEffect(int value)
        
        Allows to specify the effect to be applied to the areas where content was moved from RevisionType.MOVING. Default value is RevisionTextEffect.DOUBLE_STRIKE_THROUGHThe value of the property is RevisionTextEffect integer constant.

        Example:

        Show how to render revisions in the balloons and edit their appearance.
        Document doc = new Document(getMyDir() + "Document.Revisions.docx");
        
        // Get the RevisionOptions object that controls the appearance of revisions
        RevisionOptions revisionOptions = doc.getLayoutOptions().getRevisionOptions();
        
        // 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);
        
        // 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);
        
        doc.save(getArtifactsDir() + "Document.ShowRevisionsInBalloons.pdf");
      • getMovedToTextColor/setMovedToTextColor

        public int getMovedToTextColor() / public void setMovedToTextColor(int value)
        
        Allows to specify the color to be used for areas where content was moved to RevisionType.MOVING. Default value for this property is RevisionColor.BY_AUTHOR. The value of the property is RevisionColor integer constant.

        Example:

        Show how to render revisions in the balloons and edit their appearance.
        Document doc = new Document(getMyDir() + "Document.Revisions.docx");
        
        // Get the RevisionOptions object that controls the appearance of revisions
        RevisionOptions revisionOptions = doc.getLayoutOptions().getRevisionOptions();
        
        // 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);
        
        // 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);
        
        doc.save(getArtifactsDir() + "Document.ShowRevisionsInBalloons.pdf");
      • getMovedToTextEffect/setMovedToTextEffect

        public int getMovedToTextEffect() / public void setMovedToTextEffect(int value)
        
        Allows to specify the effect to be applied to the areas where content was moved to RevisionType.MOVING. Default value is RevisionTextEffect.DOUBLE_UNDERLINEThe value of the property is RevisionTextEffect integer constant.Values of RevisionTextEffect.HIDDEN and RevisionTextEffect.DOUBLE_STRIKE_THROUGH are not allowed and will cause System.ArgumentOutOfRangeException.

        Example:

        Show how to render revisions in the balloons and edit their appearance.
        Document doc = new Document(getMyDir() + "Document.Revisions.docx");
        
        // Get the RevisionOptions object that controls the appearance of revisions
        RevisionOptions revisionOptions = doc.getLayoutOptions().getRevisionOptions();
        
        // 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);
        
        // 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);
        
        doc.save(getArtifactsDir() + "Document.ShowRevisionsInBalloons.pdf");
      • getRevisedPropertiesColor/setRevisedPropertiesColor

        public int getRevisedPropertiesColor() / public void setRevisedPropertiesColor(int value)
        
        Allows to specify the color to be used for content with changes of formatting properties RevisionType.FORMAT_CHANGE Default value for this property is RevisionColor.NO_HIGHLIGHT. The value of the property is RevisionColor integer constant.

        Example:

        Show how to render revisions in the balloons and edit their appearance.
        Document doc = new Document(getMyDir() + "Document.Revisions.docx");
        
        // Get the RevisionOptions object that controls the appearance of revisions
        RevisionOptions revisionOptions = doc.getLayoutOptions().getRevisionOptions();
        
        // 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);
        
        // 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);
        
        doc.save(getArtifactsDir() + "Document.ShowRevisionsInBalloons.pdf");
      • getRevisedPropertiesEffect/setRevisedPropertiesEffect

        public int getRevisedPropertiesEffect() / public void setRevisedPropertiesEffect(int value)
        
        Allows to specify the effect for content areas with changes of formatting properties RevisionType.FORMAT_CHANGE Default value is RevisionTextEffect.NONEThe value of the property is RevisionTextEffect integer constant.RevisionTextEffect.HIDDEN is not allowed and will cause System.ArgumentOutOfRangeException.

        Example:

        Show how to render revisions in the balloons and edit their appearance.
        Document doc = new Document(getMyDir() + "Document.Revisions.docx");
        
        // Get the RevisionOptions object that controls the appearance of revisions
        RevisionOptions revisionOptions = doc.getLayoutOptions().getRevisionOptions();
        
        // 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);
        
        // 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);
        
        doc.save(getArtifactsDir() + "Document.ShowRevisionsInBalloons.pdf");
      • getRevisionBarsColor/setRevisionBarsColor

        public int getRevisionBarsColor() / public 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 RevisionColor.RED. The value of the property is RevisionColor integer constant. Setting this property to RevisionColor.BY_AUTHOR or RevisionColor.NO_HIGHLIGHT values will result in hiding revision bars from the layout.

        Example:

        Show how to render revisions in the balloons and edit their appearance.
        Document doc = new Document(getMyDir() + "Document.Revisions.docx");
        
        // Get the RevisionOptions object that controls the appearance of revisions
        RevisionOptions revisionOptions = doc.getLayoutOptions().getRevisionOptions();
        
        // 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);
        
        // 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);
        
        doc.save(getArtifactsDir() + "Document.ShowRevisionsInBalloons.pdf");
      • getRevisionBarsWidth/setRevisionBarsWidth

        public float getRevisionBarsWidth() / public void setRevisionBarsWidth(float value)
        
        Gets or sets width of revision bars, points.

        Example:

        Show how to render revisions in the balloons and edit their appearance.
        Document doc = new Document(getMyDir() + "Document.Revisions.docx");
        
        // Get the RevisionOptions object that controls the appearance of revisions
        RevisionOptions revisionOptions = doc.getLayoutOptions().getRevisionOptions();
        
        // 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);
        
        // 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);
        
        doc.save(getArtifactsDir() + "Document.ShowRevisionsInBalloons.pdf");
      • getShowInBalloons/setShowInBalloons

        public int getShowInBalloons() / public void setShowInBalloons(int value)
        
        Allows to specify whether the revisions are rendered in the balloons. Default value for this property is ShowInBalloons.NONEThe value of the property is ShowInBalloons integer constant.

        Example:

        Shows how render tracking changes in balloons
        Document doc = new Document(getMyDir() + "ShowRevisionBalloons.docx");
        
        //Set option true, if you need render tracking changes in balloons in pdf document
        doc.getLayoutOptions().getRevisionOptions().setShowInBalloons(ShowInBalloons.FORMAT);
        
        //Check that revisions are in balloons
        doc.save(getArtifactsDir() + "ShowRevisionBalloons.pdf");

        Example:

        Show how to render revisions in the balloons and edit their appearance.
        Document doc = new Document(getMyDir() + "Document.Revisions.docx");
        
        // Get the RevisionOptions object that controls the appearance of revisions
        RevisionOptions revisionOptions = doc.getLayoutOptions().getRevisionOptions();
        
        // 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);
        
        // 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);
        
        doc.save(getArtifactsDir() + "Document.ShowRevisionsInBalloons.pdf");
      • getShowOriginalRevision/setShowOriginalRevision

        public boolean getShowOriginalRevision() / public 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.

        Example:

        Show how to render revisions in the balloons and edit their appearance.
        Document doc = new Document(getMyDir() + "Document.Revisions.docx");
        
        // Get the RevisionOptions object that controls the appearance of revisions
        RevisionOptions revisionOptions = doc.getLayoutOptions().getRevisionOptions();
        
        // 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);
        
        // 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);
        
        doc.save(getArtifactsDir() + "Document.ShowRevisionsInBalloons.pdf");
      • getShowRevisionBars/setShowRevisionBars

        public boolean getShowRevisionBars() / public 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.

        Example:

        Shows how to set a document's layout options.
        Document doc = new Document();
        
        Assert.assertFalse(doc.getLayoutOptions().getShowHiddenText());
        Assert.assertFalse(doc.getLayoutOptions().getShowParagraphMarks());
        
        // The appearance of revisions can be controlled from the layout options property
        doc.startTrackRevisions("John Doe", new Date());
        doc.getLayoutOptions().getRevisionOptions().setInsertedTextColor(RevisionColor.BRIGHT_GREEN);
        doc.getLayoutOptions().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.");
        
        doc.getLayoutOptions().setShowHiddenText(true);
        
        doc.save(getArtifactsDir() + "Document.LayoutOptions.pdf");
      • getShowRevisionMarks/setShowRevisionMarks

        public boolean getShowRevisionMarks() / public void setShowRevisionMarks(boolean value)
        
        Allow to specify whether revision text should be marked with special formatting markup. Default value for this property is true.

        Example:

        Show how to render revisions in the balloons and edit their appearance.
        Document doc = new Document(getMyDir() + "Document.Revisions.docx");
        
        // Get the RevisionOptions object that controls the appearance of revisions
        RevisionOptions revisionOptions = doc.getLayoutOptions().getRevisionOptions();
        
        // 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);
        
        // 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);
        
        doc.save(getArtifactsDir() + "Document.ShowRevisionsInBalloons.pdf");