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.9.0

Syntax

public class LayoutOptions

The LayoutOptions type exposes the following members.

Constructors

  NameDescription
Public methodLayoutOptions
Initializes a new instance of the LayoutOptions class

Properties

  NameDescription
Public propertyCallback
Gets or sets IPageLayoutCallback implementation used by page layout model.
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 hide text in a rendered output document.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);

// Insert hidden text, then specify whether we wish to omit it from a rendered document.
builder.Writeln("This text is not hidden.");
builder.Font.Hidden = true;
builder.Writeln("This text is hidden.");

doc.LayoutOptions.ShowHiddenText = showHiddenText;

doc.Save(ArtifactsDir + "Document.LayoutOptionsHiddenText.pdf");
Shows how to show paragraph marks in a rendered output document.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);

// Add some paragraphs, then enable paragraph marks to show the ends of paragraphs
// with a pilcrow (¶) symbol when we render the document.
builder.Writeln("Hello world!");
builder.Writeln("Hello again!");

doc.LayoutOptions.ShowParagraphMarks = showParagraphMarks;

doc.Save(ArtifactsDir + "Document.LayoutOptionsParagraphMarks.pdf");
Shows how to alter the appearance of revisions in a rendered output document.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);

// Insert a revision, then change the color of all revisions to green,
// and also remove the bar that appears to the left of every revised line.
builder.Writeln("This is not a revision.");
doc.StartTrackRevisions("John Doe", DateTime.Now);
builder.Writeln("This is a revision.");
doc.StopTrackRevisions();
builder.Writeln("This is not a revision.");

doc.LayoutOptions.RevisionOptions.InsertedTextColor = RevisionColor.BrightGreen;
doc.LayoutOptions.RevisionOptions.ShowRevisionBars = false;

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

See Also