# Outline

Add an outline node in your PDF document to organize and display the document structure to the user. Learn how to modify and delete an outline node in docs.

## Content

Outline is a hierarchical list of items used to organize and display the document structure to the user so that the user can interactively navigate to a particular topic or a location in a document. For more information on outline, see <span data-teams="true">PDF Specification 2.0 (</span>Section 12.3.3).
DsPdf allows you to define an outline node in a PDF document using [OutlineNode](/document-solutions/dot-net-pdf-api/api/online/DS.Documents.Pdf/GrapeCity.Documents.Pdf.OutlineNode.html) class. You can also add child nodes to the outline nodes and choose whether to display the expanded list with visible child nodes or a compact list using [Expanded](/document-solutions/dot-net-pdf-api/api/online/DS.Documents.Pdf/GrapeCity.Documents.Pdf.OutlineNode.Expanded.html) property of the [OutlineNode ](/document-solutions/dot-net-pdf-api/api/online/DS.Documents.Pdf/GrapeCity.Documents.Pdf.OutlineNode.html)class. This class also provides methods and properties to manipulate document's outline.
![PDF Outline](https://cdn.mescius.io/document-site-files/images/884d2bfb-301b-49bc-8d90-656c5b910507/images/outlines.png)

## Add Outline Node

To add an outline node in the PDF document, pass the instance of OutlineNode class as a parameter to the [Add](https://docs.microsoft.com/en-us/dotnet/api/system.collections.objectmodel.collection-1.add?view=netframework-4.8) method.

```csharp
// Add  outline node using Add method
doc.Outlines.Add(new OutlineNode("Chapter 5", new DestinationFitH(8, null)));
```

## Get Outline Node

To get a specific outline node from the PDF document:

1. Create an object of [OutlineNodeCollection](/document-solutions/dot-net-pdf-api/api/online/DS.Documents.Pdf/GrapeCity.Documents.Pdf.OutlineNodeCollection.html) class.
2. Use the OutlineNodeCollection object to access a particular outline node using the node index.

    ```csharp
    // Get the OutlineNodeCollection
    OutlineNodeCollection nodecol = doc.Outlines;
    Console.WriteLine("Outline Title: {0}", nodecol[0].Title);
    ```

## Modify Outline Node

To modify a specific outline node in a PDF file, get the outline from [OutlineNodeCollection](/document-solutions/dot-net-pdf-api/api/online/DS.Documents.Pdf/GrapeCity.Documents.Pdf.OutlineNodeCollection.html) by specifying its index and set the new value to its properties such as [Title](/document-solutions/dot-net-pdf-api/api/online/DS.Documents.Pdf/GrapeCity.Documents.Pdf.OutlineNode.Title.html) property.

```csharp
// Modify an outline node
nodecol[6].Title = "Testing Chapter";
```

## Delete Outline Node

To delete all the outline nodes from a PDF document, use [Clear](https://docs.microsoft.com/en-us/dotnet/api/system.collections.objectmodel.collection-1.clear?view=netframework-4.8) method. Apart from this, [RemoveAt](https://docs.microsoft.com/en-us/dotnet/api/system.collections.objectmodel.collection-1.removeat?view=netframework-4.8) method can be used to delete a particular outline by specifying its index value.

```csharp
// Delete all the outline nodes
doc.Outlines.Clear();
        
// Delete a particular outline node
doc.Outlines.RemoveAt(1);
```

For more information about implementation of outlines using DsPdf, see [DsPdf sample browser](https://developer.mescius.com/documents-api-pdf/demos/basics/navigation/outlines/code-cs).

## See Also

**Demo**
[Outlines](https://www.grapecity.com/documents-api-pdf/demos/features/navigation/outlines/pdf-cs)
[ToC from Outlines](https://www.grapecity.com/documents-api-pdf/demos/use-cases/toc-from-outlines/pdf-cs)