LayoutOptions class

LayoutOptions class

Holds the options that allow controlling the document layout process. To learn more, visit the Converting to Fixed-page Format documentation article.

Remarks

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

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

Constructors

NameDescription
LayoutOptions()The default constructor.

Properties

NameDescription
callbackGets or sets IPageLayoutCallback implementation used by page layout model.
commentDisplayModeGets or sets the way comments are rendered. Default value is CommentDisplayMode.ShowInBalloons.
continuousSectionPageNumberingRestartGets or sets the mode of behavior for computing page numbers when a continuous section restarts the page numbering.
ignorePrinterMetricsGets or sets indication of whether the “Use printer metrics to lay out document” compatibility option is ignored. Default is true.
keepOriginalFontMetricsGets or sets an indication of whether the original font metrics should be used after font substitution. Default is true.
revisionOptionsGets revision options.
showHiddenTextGets or sets indication of whether hidden text in the document is rendered. Default is false.
showParagraphMarksGets or sets indication of whether paragraph marks are rendered. Default is false.

Examples

Shows how to alter the appearance of revisions in a rendered output document.

let doc = new aw.Document();
let builder = new aw.DocumentBuilder(doc);

// Insert a revision, then change the color of all revisions to green.
builder.writeln("This is not a revision.");
doc.startTrackRevisions("John Doe", Date.now());
expect(doc.layoutOptions.revisionOptions.insertedTextColor).toEqual(aw.Layout.RevisionColor.ByAuthor);
expect(doc.layoutOptions.revisionOptions.showRevisionBars).toEqual(true);
builder.writeln("This is a revision.");
doc.stopTrackRevisions();
builder.writeln("This is not a revision.");

// Remove the bar that appears to the left of every revised line.
doc.layoutOptions.revisionOptions.insertedTextColor = aw.Layout.RevisionColor.BrightGreen;
doc.layoutOptions.revisionOptions.showRevisionBars = false;
doc.layoutOptions.revisionOptions.revisionBarsPosition = aw.Drawing.HorizontalAlignment.Right;

doc.save(base.artifactsDir + "Revision.LayoutOptionsRevisions.pdf");

See Also