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
Name | Description |
---|---|
LayoutOptions() | The default constructor. |
Properties
Name | Description |
---|---|
callback | Gets or sets IPageLayoutCallback implementation used by page layout model. |
commentDisplayMode | Gets or sets the way comments are rendered. Default value is CommentDisplayMode.ShowInBalloons. |
continuousSectionPageNumberingRestart | Gets or sets the mode of behavior for computing page numbers when a continuous section restarts the page numbering. |
ignorePrinterMetrics | Gets or sets indication of whether the “Use printer metrics to lay out document” compatibility option is ignored. Default is true . |
keepOriginalFontMetrics | Gets or sets an indication of whether the original font metrics should be used after font substitution. Default is true . |
revisionOptions | Gets revision options. |
showHiddenText | Gets or sets indication of whether hidden text in the document is rendered. Default is false . |
showParagraphMarks | Gets 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
- module Aspose.Words.Layout