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

Show in webframe

LoadFromFile Method






Path to the file name containing the original document data. This value cannot be null.
Options to use when loading the document. This value cannot be null.
Loads a document from existing data stored in a disk file.
Syntax
public static Document LoadFromFile( 
   string fileName,
   LoadDocumentOptions options
)
'Declaration
 
Public Shared Function LoadFromFile( _
   ByVal fileName As String, _
   ByVal options As LoadDocumentOptions _
) As Document
'Usage
 
Dim fileName As String
Dim options As LoadDocumentOptions
Dim value As Document
 
value = DocumentFactory.LoadFromFile(fileName, options)
public static Document loadFromFile(String fileName, LoadDocumentOptions options)
            
public:
static Document^ LoadFromFile( 
   String^ fileName,
   LoadDocumentOptions^ options
) 

Parameters

fileName
Path to the file name containing the original document data. This value cannot be null.
options
Options to use when loading the document. This value cannot be null.

Return Value

The newly created document object.
Remarks

This method might use the cache and will throw an exception if neither of LoadDocumentOptions.Cache or Cache was setup with a valid cache object if certain options are used.

LoadFromFile, LoadFromUri, LoadFromUriAsync and LoadFromStream creates a Document class from any supported image or document file format stored in a disk file, remote URL or a stream. The returned object can then be used to retrieve any page as image or SVG, to obtain the text using SVG or OCR, use the annotations or the document structure such as links and bookmarks.

After the document is obtained, InternalObject will be to the internal LEADTOOLS object used with the document.

Refer to Loading Using LEADTOOLS Documents Library for detailed information on how to use this method and the various options used.

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 DocumentFactoryLoadFromFileExample()
   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 DocumentFactoryLoadFromFileExample()
{
   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 Class
DocumentFactory Members

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