# Quick Start

## Content

This quick start topic guides you through a step-by-step process of creating a simple application for loading a PDF file in the FlexViewer control. It uses a PDF file named DefaultDocument.pdf, taken from the C1PdfDocumentSource product sample.

The following image shows a PDF file loaded in FlexViewer.
![](https://cdn.mescius.io/document-site-files/images/4a35dced-dcb9-4518-88b2-cb3b788a064c/images/loadingpdfflexviewer.png)

### To load a PDF file in FlexViewer programmatically

* [Step 1: Setting up the application](/componentone/docs/wpf/online-document/PDFDocumentSource-for-WPF/PDFDocumentSource-Quick-Start#step-1-setting-up-the-application)
* [Step 2: Load the PDF file in FlexViewer](/componentone/docs/wpf/online-document/PDFDocumentSource-for-WPF/PDFDocumentSource-Quick-Start#step-2-load-the-pdf-file-in-flexviewer)
* [Step 3: Build and run the project](/componentone/docs/wpf/online-document/PDFDocumentSource-for-WPF/PDFDocumentSource-Quick-Start#step-3-build-and-run-the-project)

#### Step 1: Setting up the application

1. Create a new WPF application.
2. Drag and drop **C1FlexViewer** control in the XAML view.

#### Step 2: Load the PDF file in FlexViewer

1. Switch to the code view and add the following namespace.

    ```vbnet
    Imports C1.WPF.Document
    ```

    ```csharp
    using C1.WPF.Document;
    ```
2. Add a PDF file to the project. In our case, we have used PDF file named DefaultDocument.pdf from the product sample.
3. Add the following code in the **MainWindow()** class constructor to create an instance of C1PdfDocumentSource and load the PDF file using LoadFromFile method.

    ```vbnet
    Dim pds As New C1PdfDocumentSource()
    pds.LoadFromFile("..\..\DefaultDocument.pdf")
    ```

    ```csharp
    C1PdfDocumentSource pds = new C1PdfDocumentSource();
    pds.LoadFromFile(@"..\..\DefaultDocument.pdf");
    ```
4. Render the PDF file in the FlexViewer control using **DocumentSource** property.

    ```vbnet
    viewer.DocumentSource = pds
    ```

    ```csharp
    viewer.DocumentSource = pds;
    ```

#### Step 3: Build and run the project

1. Press **Ctrl+Shift+B** to build the project.
2. Press **F5** to run the application.

## See Also

[Key Features](/componentone/docs/wpf/online-document/PDFDocumentSource-for-WPF/PDFDocumentSource-Key-Features)
[Features](/componentone/docs/wpf/online-document/PDFDocumentSource-for-WPF/Features)