Class LoadOptions

Class LoadOptions

Namespace: Aspose.Note
Assembly: Aspose.Note.dll (25.6.0)

Options used to load a document.

public class LoadOptions
{
    public bool KeepTextOnly { get; set; } = true;
    public bool UseSimpleFormat { get; set; } = false;
    public Font DefaultFont { get; set; } = new Font();
}

Inheritance

object LoadOptions

Inherited Members

object.GetType() , object.MemberwiseClone() , object.ToString() , object.Equals(object?) , object.Equals(object?, object?) , object.ReferenceEquals(object?, object?) , object.GetHashCode()

Examples

Shows how to an encrypted document.

string dataDir = RunExamples.GetDataDir_LoadingAndSaving();
   LoadOptions loadOptions = new LoadOptions() { DocumentPassword = "password" };
   Document doc = new Document(dataDir + "Sample1.one", loadOptions);

Shows how to an encrypted notebook.

var dataDir = RunExamples.GetDataDir_NoteBook();
   var notebook = new Notebook(dataDir + "test.onetoc2", new NotebookLoadOptions() { DeferredLoading = true });
   notebook.LoadChildDocument(dataDir + "Aspose.one");
   notebook.LoadChildDocument(dataDir + "Locked Pass1.one", new LoadOptions() { DocumentPassword = "pass" });
   notebook.LoadChildDocument(dataDir + "Locked Pass2.one", new LoadOptions() { DocumentPassword = "pass2" });

Shows how to get page’s history.

string dataDir = RunExamples.GetDataDir_Pages();
   Document document = new Document(dataDir + "Aspose.one", new LoadOptions { LoadHistory = true });
   Page firstPage = document.FirstChild;
   foreach (Page pageRevision in document.GetPageHistory(firstPage))
   {
      Console.WriteLine("LastModifiedTime: {0}", pageRevision.LastModifiedTime);
      Console.WriteLine("CreationTime: {0}", pageRevision.CreationTime);
      Console.WriteLine("Title: {0}", pageRevision.Title);
      Console.WriteLine("Level: {0}", pageRevision.Level);
      Console.WriteLine("Author: {0}", pageRevision.Author);
      Console.WriteLine();
   }

Constructors

LoadOptions()

public LoadOptions
   {
   }

Properties

DocumentPassword

Gets or sets a password for the encrypted document content. Value is ignored in case the document is not password protected.

public string DocumentPassword
    {
        get;
        set;
    }

Property Value

string

Examples

Shows how to an encrypted document.

string dataDir = RunExamples.GetDataDir_LoadingAndSaving();
      LoadOptions loadOptions = new LoadOptions() { DocumentPassword = "password" };
      Document doc = new Document(dataDir + "Sample1.one", loadOptions);

Shows how to an encrypted notebook.

var dataDir = RunExamples.GetDataDir_NoteBook();
   var notebook = new Notebook(dataDir + "test.onetoc2", new NotebookLoadOptions() { DeferredLoading = true });
   notebook.LoadChildDocument(dataDir + "Aspose.one");
   notebook.LoadChildDocument(dataDir + "Locked Pass1.one", new LoadOptions() { DocumentPassword = "pass" });
   notebook.LoadChildDocument(dataDir + "Locked Pass2.one", new LoadOptions() { DocumentPassword = "pass2" });

LoadHistory

Gets or sets a value indicating whether a document loader should ignore the history.Use this option to decrease memory and CPU usage.Default value is ’true'.

public bool LoadHistory
    {
        get;
        set;
    }

Property Value

bool

Examples

Shows how to get page’s history.

string dataDir = RunExamples.GetDataDir_Pages();
   Document document = new Document(dataDir + "Aspose.one", new LoadOptions { LoadHistory = true });
   Page firstPage = document.FirstChild;
   foreach (Page pageRevision in document.GetPageHistory(firstPage))
   {
       Console.WriteLine("LastModifiedTime: {0}", pageRevision.LastModifiedTime);
       Console.WriteLine("CreationTime: {0}", pageRevision.CreationTime);
       Console.WriteLine("Title: {0}", pageRevision.Title);
       Console.WriteLine("Level: {0}", pageRevision.Level);
       Console.WriteLine("Author: {0}", pageRevision.Author);
       Console.WriteLine();
   }
 English