# Loading and Saving Documents

## Content

Editor provides built-in options to load and save the documents. Let us explore these options in the following sections.

## Load Documents

With Editor, you can easily load the stored documents. Loading the stored documents also helps in reducing your time and effort in re-creating them. You can use **Load** option from the Quick Access Toolbar to load a document at runtime. Besides this, you can use [LoadDocument](/componentone/docs/win/online-editor-net/#LOADDOCUMENT) and [LoadDocumentRequest](/componentone/docs/win/online-editor-net/) methods of the [C1Editor](/componentone/docs/win/online-editor-net/) class to deserialize the data from the XML or XHTML file. The **LoadDocument** method loads the specified document whereas the **LoadDocumentRequest** method opens the file dialog to load the selected document.

The following code demonstrates how to load a document in Editor using the **LoadDocument** method. In this example, the content gets loaded from a file named tesla.html.

```csharp
c1Editor1.LoadDocument(@"C:\tesla.html");
```

## Save Documents

You can save your documents with Editor at runtime by using **Save** option from the Quick Access Toolbar. Besides this, you can use [SaveDocument](/componentone/docs/win/online-editor-net/#SAVEDOCUMENT) and [SaveDocumentRequest](/componentone/docs/win/online-editor-net/) methods of the [C1Editor](/componentone/docs/win/online-editor-net/) class. The **SaveDocument** method saves the specified document whereas the **SaveDocumentRequest** method opens the file dialog to save the Editor content to the selected file.

The following code snippet demonstrates how to save the Editor's content to a file using the **SaveDocument** method. In this example, the content gets saved to a file named Demo.html in the bin directory of the project folder.

```csharp
c1Editor1.SaveDocument("Demo.html");
```

>type=info
> Note:
> **Text color:** Custom font colors may not be preserved correctly when saving to RTF.
> **Text highlight color:** Text highlighting (distinct from background color) is not supported in exported RTF files.

### Save Document to PDF

PDF is one of the most commonly used formats to share the documents as it preserves formatting. Editor lets you save the documents as PDF using **SaveDocumentToPDF** method of the **C1Editor** class. This method accepts the absolute path of the location to save the document. In the following example, the document is saved as TestDemo.pdf in the Resources directory of the project folder.

```csharp
c1Editor1.SaveDocumentToPDF(@"\Resources\TestDemo.pdf");
```