OutlineOptions Class

Allows to specify outline options.

ExpandedInheritance Hierarchy


Namespace:  Aspose.Words.Saving
Assembly:  Aspose.Words (in Aspose.Words.dll) Version: 21.5.0


public class OutlineOptions

The OutlineOptions type exposes the following members.


Public methodOutlineOptions
Initializes a new instance of the OutlineOptions class


Public propertyCode exampleBookmarksOutlineLevels
Allows to specify individual bookmarks outline level.
Public propertyCode exampleCreateMissingOutlineLevels

Gets or sets a value determining whether or not to create missing outline levels when the document is exported.

Default value for this property is false.

Public propertyCode exampleCreateOutlinesForHeadingsInTables
Specifies whether or not to create outlines for headings (paragraphs formatted with the Heading styles) inside tables.
Public propertyCode exampleDefaultBookmarksOutlineLevel
Specifies the default level in the document outline at which to display Word bookmarks.
Public propertyCode exampleExpandedOutlineLevels
Specifies how many levels in the document outline to show expanded when the file is viewed.
Public propertyCode exampleHeadingsOutlineLevels
Specifies how many levels of headings (paragraphs formatted with the Heading styles) to include in the document outline.


Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)


Shows to process bookmarks in headers/footers in a document that we are rendering to PDF.
Document doc = new Document(MyDir + "Bookmarks in headers and footers.docx");

// Create a "PdfSaveOptions" object that we can pass to the document's "Save" method
// to modify how that method converts the document to .PDF.
PdfSaveOptions saveOptions = new PdfSaveOptions();

// Set the "PageMode" property to "PdfPageMode.UseOutlines" to display the outline navigation pane in the output PDF.
saveOptions.PageMode = PdfPageMode.UseOutlines;

// Set the "DefaultBookmarksOutlineLevel" property to "1" to display all
// bookmarks at the first level of the outline in the output PDF.
saveOptions.OutlineOptions.DefaultBookmarksOutlineLevel = 1;

// Set the "HeaderFooterBookmarksExportMode" property to "HeaderFooterBookmarksExportMode.None" to
// not export any bookmarks that are inside headers/footers.
// Set the "HeaderFooterBookmarksExportMode" property to "HeaderFooterBookmarksExportMode.First" to
// only export bookmarks in the first section's header/footers.
// Set the "HeaderFooterBookmarksExportMode" property to "HeaderFooterBookmarksExportMode.All" to
// export bookmarks that are in all headers/footers.
saveOptions.HeaderFooterBookmarksExportMode = headerFooterBookmarksExportMode;

doc.Save(ArtifactsDir + "PdfSaveOptions.HeaderFooterBookmarksExportMode.pdf", saveOptions);

ExpandedSee Also