OverviewDocument Toolkit Help

The Document Toolkit API consists of two assemblies. The FirstFloor.Documents assembly contains the core document object model with document loading and parsing. The object model provides detailed access to all aspects of a document and its metadata. The asynchronous document readers support both complete and partially loaded documents. The FirstFloor.Documents.Controls assembly contains the set of visual controls and UI helpers for displaying documents in Silverlight.

Core Object Model

The Document Toolkit API resembles the WPF Document API. The XpsDocument class is the root of the object model. XpsDocument has one or more FixedDocument instances, where each FixedDocument instance contains zero or more pages identified by the PageContent class. The PageContent type encapsulates page information, and is used to create FixedPage instances. FixedPage is the actual UI panel element containing text, images and other UI elements. PageContent elements have one or more LinkTarget instances containing references to other pages or external URI’s.

The FirstFloor.Documents.IO namespace contains all classes related to loading and processing document packages. The IPackageReader and IPackagePartRequest interfaces define the contracts for loading package data. A custom implementation of these interfaces allows for loading packages from virtually any location.

The FirstFloor.Documents.DocumentStructures namespace provides class for document metadata. Metadata such as Table of Contents and story elements are defined.

Features of the core object model;

  • 100% Silverlight client-side solution. No server-side dependencies.
  • Supports Silverlight 4
  • Asynchronous document readers for non-blocking UI based on the Event-based Asynchronous Pattern.
  • Extensible API supports custom document readers that allows for loading documents from virtually any source
  • On-the-fly font resource loading and unloading
  • Text selection support
  • Extensible annotation framework
  • Font parsing and detailed font metrics API.
  • Extensible full text search
  • API closely resembles WPF Document API
  • Takes full advantage of LINQ
  • Partial document loading over HTTP using the built-in WebPackageReader. The WebPackageReader only loads the parts required to render the visible pages, instead of an entire package. Partial document loading typically has faster start-up times.
User Interface

The user interface elements are available in the FirstFloor.Documents.Controls assembly. The user interface provides the following features;

  • DocumentViewer with on-demand page loading and rendering and support for various scale modes. Proper disposal patterns in place avoiding extensive memory usage when viewing large documents.
  • Easy to use data source for loading, filtering, and searching documents without having to write a single letter of code.
  • Printing capabilities
  • Scalable FixedPageViewer displaying single pages
  • Customizable controls utilizing well-known patterns such as the Silverlight Parts & States model.
  • Full keyboard and mouse support (including mouse wheel support for scrolling)
  • Built-in control localization support