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: 20.8.0

Syntax

public LayoutOptions LayoutOptions { get; }

Property Value

Type: LayoutOptions

Examples

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

// The appearance of revisions can be controlled from the layout options property
doc.StartTrackRevisions("John Doe", DateTime.Now);
options.RevisionOptions.InsertedTextColor = RevisionColor.BrightGreen;
options.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.");

options.ShowHiddenText = 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.ShowParagraphMarks = true;

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

See Also