LayoutOptions Class

Holds the options that allow controlling the document layout process.
Inheritance Hierarchy
SystemObject
  Aspose.Words.LayoutLayoutOptions

Namespace:  Aspose.Words.Layout
Assembly:  Aspose.Words (in Aspose.Words.dll) Version: 20.3
Syntax
public class LayoutOptions

The LayoutOptions type exposes the following members.

Properties
  NameDescription
Public propertyCode exampleRevisionOptions
Gets revision options.
Public propertyCode exampleShowComments
Gets or sets indication of whether comments are rendered. Default is True.
Public propertyCode exampleShowHiddenText
Gets or sets indication of whether hidden text in the document is rendered. Default is False.
Public propertyCode exampleShowParagraphMarks
Gets or sets indication of whether paragraph marks are rendered. Default is False.
Public propertyCode exampleTextShaperFactory
Gets or sets ITextShaperFactory implementation used for Advanced Typography rendering features.
Methods
  NameDescription
Public methodEquals (Inherited from Object.)
Public methodGetHashCode (Inherited from Object.)
Public methodGetType (Inherited from Object.)
Public methodToString (Inherited from Object.)
Remarks

You do not create instances of this class directly. Use the LayoutOptions property to access layout options for this document.

Note that after changing any of the options present in this class, UpdatePageLayout method should be called in order for the changed options to be applied to the layout.

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

Assert.IsFalse(doc.LayoutOptions.ShowHiddenText);
Assert.IsFalse(doc.LayoutOptions.ShowParagraphMarks);

// The appearance of revisions can be controlled from the layout options property
doc.StartTrackRevisions("John Doe", DateTime.Now);
doc.LayoutOptions.RevisionOptions.InsertedTextColor = RevisionColor.BrightGreen;
doc.LayoutOptions.RevisionOptions.ShowRevisionBars = 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.Font.Hidden = true;
builder.Writeln(
    "This text is hidden. It will only show up in the output if we allow it to via doc.LayoutOptions.");

doc.LayoutOptions.ShowHiddenText = true;

doc.Save(ArtifactsDir + "Document.LayoutOptions.pdf");
See Also