←Select platform

AnnotationsUri Property

Summary

The location to the external annotation file associated with the document.

Syntax
C#
C++/CLI
Java
Python
public Uri AnnotationsUri { get; set; } 
public:  
   property System::Uri^ AnnotationsUri 
   { 
      System::Uri^ get() 
      void set(System::Uri^ value) 
   } 
public URI getAnnotationsUri() 
public void setAnnotationsUri(URI value) 
AnnotationsUri # get and set (LoadDocumentOptions) 

Property Value

The location to the external annotation file associated with the document. Default value is null.

Remarks

Documents can have annotations stored in an external file. To read these annotations when the document is loaded, set the value of AnnotationsUri to the file or remote URL location. The framework will load the annotation from this location and download it in the cache if needed.

If the value of AnnotationsUri is set (not null), then LoadEmbeddedAnnotations is ignored and the framework will not try to load any embedded annotations even if they exist.

Use DocumentPage.GetAnnotations to access the annotations after the document is loaded.

Refer to Loading Documents using Leadtools.Document for detailed information.

Example
C#
Java
using Leadtools; 
using Leadtools.Caching; 
using Leadtools.Document; 
 
 
public void DocumentFactoryLoadFromFileExample() 
{ 
   var options = new LoadDocumentOptions(); 
   options.AnnotationsUri = null; 
   options.FirstPageNumber = 1; 
   options.LastPageNumber = -1; 
   options.Password = null; 
   options.WebClient = null; 
   options.CachePolicy = new CacheItemPolicy(); 
   using (var document = DocumentFactory.LoadFromFile(Path.Combine(LEAD_VARS.ImagesDir, "Leadtools.pdf"), options)) 
   { 
      PrintOutDocumentInfo(document); 
   } 
} 
 
static class LEAD_VARS 
{ 
   public const string ImagesDir = @"C:\LEADTOOLS23\Resources\Images"; 
} 
 
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.*; 
 
 
public void documentFactoryLoadFromFileExample() { 
   final String LEAD_VARS_IMAGES_DIR = "C:\\LEADTOOLS23\\Resources\\Images"; 
   LoadDocumentOptions options = new LoadDocumentOptions(); 
   options.setAnnotationsUri(null); 
   options.setFirstPageNumber(1); 
   options.setLastPageNumber(-1); 
   options.setPassword(null); 
   options.setCachePolicy(new CacheItemPolicy()); 
   LEADDocument document = DocumentFactory.loadFromFile(combine(LEAD_VARS_IMAGES_DIR, "Leadtools.pdf"), options); 
   printOutDocumentInfo(document); 
   assertTrue(document != null); 
   System.out.println("Document created successfully"); 
   document.dispose(); 
} 

or DocumentFactory.LoadFromUri.

Requirements

Target Platforms

Help Version 23.0.2024.2.29
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2024 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Document Assembly

Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.