Loads a document from existing data stored in a disk file.
public static Document LoadFromFile(
string fileName,
LoadDocumentOptions options
)
Public Shared Function LoadFromFile(
ByVal fileName As String,
ByVal options As LoadDocumentOptions
) As Document
public:
static Document^ LoadFromFile(
String^ fileName,
LoadDocumentOptions^ options
)
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.
The newly created document object.
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.
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;
public static void DocumentFactoryLoadFromFileExample()
{
var options = new LoadDocumentOptions();
using (var document = DocumentFactory.LoadFromFile(Path.Combine(ImagesPath.Path, "Leadtools.pdf"), options))
{
PrintOutDocumentInfo(document);
}
}
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 Shared Sub DocumentFactoryLoadFromFileExample()
Dim options As New LoadDocumentOptions()
Using document As Leadtools.Documents.Document = DocumentFactory.LoadFromFile(Path.Combine(ImagesPath.Path, "Leadtools.pdf"), options)
PrintOutDocumentInfo(document)
End Using
End Sub
Products |
Support |
Feedback: LoadFromFile Method (DocumentFactory) - Leadtools.Documents |
Introduction |
Help Version 19.0.2017.3.22
|
Raster .NET | C API | C++ Class Library | JavaScript HTML5
Document .NET | C API | C++ Class Library | JavaScript HTML5
Medical .NET | C API | C++ Class Library | JavaScript HTML5
Medical Web Viewer .NET
Your email has been sent to support! Someone should be in touch! If your matter is urgent please come back into chat.
Chat Hours:
Monday - Friday, 8:30am to 6pm ET
Thank you for your feedback!
Please fill out the form again to start a new chat.
All agents are currently offline.
Chat Hours:
Monday - Friday
8:30AM - 6PM EST
To contact us please fill out this form and we will contact you via email.