Skip to content

# PDFVisualDocument

Namespace: O2S.Components.PDF4NET.View

Defines a PDF document that is displayed in a viewer control.

    public class PDFVisualDocument : System.ComponentModel.Component

Inheritance Object → MarshalByRefObject → Component → PDFVisualDocument
Implements

## Constructors

### PDFVisualDocument()

Initializes a new PDFVisualDocument object.

    public PDFVisualDocument()

### PDFVisualDocument(IContainer)

Initializes a new PDFVisualDocument object.

    public PDFVisualDocument(IContainer container)

Parameters

`container` IContainer
The container of this object.

## Properties

### Container

    public IContainer Container { get; }

Property Value

IContainer

### FixedDocument

Gets the underlying fixed document.

    public PDFFixedDocument FixedDocument { get; }

Property Value

PDFFixedDocument
A object representing the PDF document displayed in a control.

### Pages

Gets the pages collection.

    public PDFVisualPageCollection Pages { get; }

Property Value

PDFVisualPageCollection
A collection of PDFVisualPage objects representing the pages included in the document that are displayed in a control.

### Site

    public ISite Site { get; set; }

Property Value

ISite

## Methods

### Close()

Closes the PDF document.

    public void Close()

### Load(PDFFixedDocument)

Loads a visual PDF document from a object.

    public void Load(PDFFixedDocument fixedDocument)

Parameters

`fixedDocument` PDFFixedDocument
Source PDF document.

### Load(String, String)

Loads a visual PDF document from a file.

    public void Load(string fileName, string password)

Parameters

`fileName` String
Path to PDF file.

`password` String
Optional password for opening the PDF file.

Remarks

When a PDFVisualDocument object is loaded from a stream of a file, the corresponding PDF file is loaded partially to reduce memory usage. This partial load requires all changes to be saved in incremental update mode.

### Load(Stream, String)

Loads a visual PDF document from a stream.

    public void Load(Stream stream, string password)

Parameters

`stream` Stream
Source stream containing the PDF file.

`password` String
Optional password for opening the PDF file.

Remarks

When a PDFVisualDocument object is loaded from a stream of a file, the corresponding PDF file is loaded partially to reduce memory usage. This partial load requires all changes to be saved in incremental update mode.

### Save(String)

Saves the PDF document to file.

    public void Save(string fileName)

Parameters

`fileName` String
Path to file where the document will be saved.

### Save(Stream)

Saves the PDF document to a stream.

    public void Save(Stream stream)

Parameters

`stream` Stream
Destination stream where the document will be saved.

## Events

### Disposed

    public event EventHandler Disposed;