Error processing SSI file
LEADTOOLS Leadtools.Documents (Leadtools.Documents assembly)

Show in webframe

DocumentFactory Class






Members 
Provide supports to load and create Document objects as well as managing the global cache.
Object Model
Syntax
public static class DocumentFactory 
'Declaration
 
Public MustInherit NotInheritable Class DocumentFactory 
'Usage
 
Dim instance As DocumentFactory
public final class DocumentFactory
            
public ref class DocumentFactory abstract sealed 
Remarks

The main class used for the LEADTOOLS Documents class library is Document. This class abstracts the internal implementation to provide unified properties and methods to access the internal document. Users can create a new document or load existing documents from disk file or a URL.

Documents cannot be created directly, instead, use the static DocumentFactory methods to obtain a Document instance as follows:

Member Description
LoadFromFile

Loads a document from existing data stored in a disk file

LoadFromUri

Loads a document from existing data stored in a remote URL

LoadFromUriAsync

Loads a document asynchronously from an existing data stored in remote URL

LoadFromStream

Loads a document from existing data stored in a stream

RasterCodecsTemplate

Global template used when loading and saving raster and SVG images

When combined with LEADTOOLS File Cache, the DocumentFactory provide the following extra functionality:

Member Description
Cache

The global LEADTOOLS File Cache object responsible for managing cache items and expiration policies. The cache can be stored in this value (if the system requires the use of a single global cache) or a new instance is passed directly to the various uploading, loading and saving methods to use distinct or shared caches with each document.

Create

Creates a new empty document

LoadFromCache

Loads a previously saved document from the cache

BeginUpload, UploadDocument and AbortUploadDocument

Provides support for uploading a document to the cache system used by the factory

Example
Copy Code  
Imports Leadtools
Imports Leadtools.Codecs
Imports Leadtools.Forms.DocumentWriters
Imports Leadtools.Svg
Imports Leadtools.Documents
Imports Leadtools.Caching
Imports Leadtools.Annotations.Core
Imports Leadtools.Barcode
Imports Leadtools.Forms.Ocr

<TestMethod()> _
Public Sub DocumentFactoryExample()
   Dim options As New LoadDocumentOptions()
   options.UseCache = False
   Using document As Leadtools.Documents.Document = DocumentFactory.LoadFromFile(Path.Combine(ImagesPath.Path, "Leadtools.pdf"), options)
      PrintOutDocumentInfo(document)
   End Using
End Sub
using Leadtools;
using Leadtools.Codecs;
using Leadtools.Forms.DocumentWriters;
using Leadtools.Svg;
using Leadtools.Documents;
using Leadtools.Caching;
using Leadtools.Annotations.Core;
using Leadtools.Forms.Ocr;
using Leadtools.Barcode;

[TestMethod]
public void DocumentFactoryExample()
{
   var options = new LoadDocumentOptions();
   options.UseCache = false;
   using (var document = DocumentFactory.LoadFromFile(Path.Combine(ImagesPath.Path, "Leadtools.pdf"), options))
   {
      PrintOutDocumentInfo(document);
   }
}
Requirements

Target Platforms

See Also

Reference

DocumentFactory Members
Leadtools.Documents Namespace
Documents Library Features
Loading Using LEADTOOLS Documents Library
Documents Library Coordinate System
Loading Encrypted Files Using the Documents Library
Parsing Text with the Documents Library
Barcode processing with the Documents Library
Using LEADTOOLS Document Viewer
Using LEADTOOLS Document Converters

Error processing SSI file
   Leadtools.Documents requires a Document or Medical toolkit license and unlock key. For more information, refer to: LEADTOOLS Toolkit Features