Error processing SSI file
LEADTOOLS Documents

Show in webframe

The Documents library supports loading by creating a Document object from data that reside in a disk file or a remote URL or data that was previously uploaded to the cache system.

This topic discusses the loading the information associated with representing a document as a Document object. For a discussion of loading individual page images or thumbnails for a DocumentPage, see Image Loading.

Loading from remote URL

To create a Document object from a remote URL call LoadFromUri, passing the URL pointing to the remote location of the document file and an instance (which can be null) of LoadDocumentOptions. Refer to LoadFromUri for an example.

Following is an explanation on how this method works.

  1. If the uri passed to LoadFromUri has the special LEAD cache scheme (detected using IsUploadDocumentUri), then the factory assumes this is the URI to a document previously uploaded to the cache using LoadFromUri and steps below are not performed and no data is downloaded. The data is already in the cache and the factory skips to step 4 below.

  2. If the value of AnnotationsUri is not null, then it will be treated as a remote URL and the data is downloaded by the factory in the same manner used for the document file as explained below.

  3. The factory will downloaded the document dta from uri into the cache system.

  4. Similarly, if AnnotationsUri is not null, it will be downloaded to the cache system.

  5. The factory will obtain information on the file format on the downloaded or temporary file. If this fails (invalid file format or the required LEADTOOLS file format assembly is not found), then the cache data is deleted and an exception is thrown.

  6. A Document object is created and the following members are initialized:

    Member Value
    DocumentId

    A unique identifier created for this document that can be used if the document is saved to the cache.

    Uri

    Same uri passed to LoadFromUri.

    IsDownloaded

    true since the document was downloaded.

    MimeType

    The MIME type of the document file format set during load.

    IsEncrypted

    false unless the document is encrypted. In this case most of the document properties cannot be used before the document is decrypted. Refer to Loading Encrypted Files Using the Documents Library for more information.

    IsDecrypted

    false

    IsStructureSupported

    true or false based on the MIME type of the document.

    Metadata

    Ready to be used.

    Structure

    Ready to be used.

    Images

    Ready to be used.

    Text

    Ready to be used.

    Pages

    Ready to be used.

    Annotations

    Ready to be used.

  7. LoadFromUri returns with this Document object ready to be used.

  8. Document will parse data from the downloaded data, therefore the original URL is never used again and the data it points to can be deleted right away if necessary.

Refer to LoadFromUri for an example.

Loading from Cache

As stated above, a valid uri to a Document in the cache scheme can be retrieved from LoadFromUri without issue. However, LoadFromCache also exists as a subset of LoadFromUri's functionality for instances in which a Document has already been loaded once but must be loaded again. LoadFromCache does not take a LoadDocumentOptions object.

LoadFromCache uses the DocumentId property to download the Document data, so that value may be stored instead of the Uri when holding on to cache items for later.

Refer to LoadFromUri for an example.

See Also

Reference

Documents Library Features
Document Viewer Application
Uploading Using the 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 jQuery Promises in the Documents Library
Loading Images in the Documents Library
Using LEADTOOLS Document Viewer

Error processing SSI file