# Load Document

Learn how to load documnts using PdfDocumentSource.

## Content



PdfDocumentSource allows you to load a PDF document in FlexViewer using two methods, **LoadFromFile** and **LoadFromStream**, of **C1PdfDocumentSource** class. The LoadFromFile method loads the document from the source file and the **LoadFromStream** method loads the document from the source stream.

### Load from file

The following code uses the **LoadFromFile** method to load a PDF document from source file.

```csharp
pdfDocSource.LoadFromFile(@"..\..\DefaultDocument.pdf");
```

### Load from stream

The following code uses the **LoadFromStream** method to load a PDF document from source stream.

```csharp
//Load report from stream
Assembly asm = GetType().Assembly;
using (Stream stream =
asm.GetManifestResourceStream(@"LoadPDFfromStream.Resources.DefaultDocument.pdf"))
c1PdfDocumentSource1.LoadFromStream(stream);
```

**Limitations of PdfDocumentSource**

Following are minor limitations of PdfDocumentSource:

*   Does not support PDF Type3 fonts.
*   Does not support pencil marks.