Gets the loaded LEADDocument object.
public LEADDocument Document {get;}
public:
property LEADDocument^ Document
{
LEADDocument^ get()
}
Document # get (LoadAsyncCompletedEventArgs)
The resulting loaded LEADDocument object if the load operation was successful; otherwise, null.
The Document will contain the ready-to-use loaded document if the operation was successful.
The value will be null if:
If the value of System.ComponentModel.AsyncCompletedEventArgs.Cancelled is true, indicating that the operation was canceled by the user. This happens if the user had set the value of IsCancelPending to true while monitoring the Progress event.
If the value of System.ComponentModel.AsyncCompletedEventArgs.Error is not null. This happens when an error occurs while the document is being loaded. This could range from network errors thrown by the operating system to invalid file formats thrown by the LEADTOOLS framework as well as any user errors thrown by the user while monitoring the Progress event.
using Leadtools;
using Leadtools.Caching;
using Leadtools.Document;
public void DocumentFactoryLoadFromUriAsyncExample()
{
AutoResetEvent finished = null;
EventHandler<LoadAsyncCompletedEventArgs> completed = null;
// LoadAsyncProgressEventArgs reference
EventHandler<LoadAsyncProgressEventArgs> progress = null;
completed = (sender, e) =>
{
//Assert((int)e.UserState == 1);
if (e.Cancelled)
Console.WriteLine("Canceled");
if (e.Error != null)
Console.WriteLine("Error:" + e.Error.Message);
if (e.Document == null)
Console.WriteLine("Document is null");
var thisOptions = sender as LoadDocumentAsyncOptions;
thisOptions.Completed -= completed;
if (e.Document != null)
{
PrintOutDocumentInfo(e.Document);
}
finished.Set();
Console.WriteLine("Done");
};
progress = (sender, f) =>
{
Console.WriteLine(f.BytesReceived);
Console.WriteLine(f.IsCancelPending);
Console.WriteLine(f.TotalBytesToReceive);
var thisOptions = sender as LoadDocumentAsyncOptions;
thisOptions.Progress -= progress;
};
var options = new LoadDocumentAsyncOptions();
options.Completed += completed;
finished = new AutoResetEvent(false);
DocumentFactory.LoadFromUriAsync(new Uri("http://localhost/Leadtools.pdf"), options);
finished.WaitOne();
}
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.Calendar;
import org.junit.*;
import org.junit.runner.JUnitCore;
import org.junit.runner.Result;
import org.junit.runner.notification.Failure;
import static org.junit.Assert.*;
import leadtools.*;
import leadtools.caching.*;
import leadtools.document.*;
// LOAD FROM URI ASYNC DOES NOT EXIST
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document