DocumentLayoutOptions Property
Gets a LayoutOptions object that represents options to control the layout process of this document.

Namespace: Aspose.Words
Assembly: Aspose.Words (in Aspose.Words.dll) Version: 19.11
Syntax
public LayoutOptions LayoutOptions { get; }

Property Value

Type: LayoutOptions
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