TxtLoadOptions
Contents
[
Hide
]TxtLoadOptions class
Allows to specify additional options when loading Text document into a Document
object.
To learn more, visit the Specify Load Options documentation article.
public class TxtLoadOptions : LoadOptions
Constructors
Name | Description |
---|---|
TxtLoadOptions() | Initializes a new instance of this class with default values. |
Properties
Name | Description |
---|---|
AutoNumberingDetection { get; set; } | Gets or sets a boolean value indicating either automatic numbering detection will be performed while loading a document. The default value is true . |
BaseUri { get; set; } | Gets or sets the string that will be used to resolve relative URIs found in the document into absolute URIs when required. Can be null or empty string. Default is null . |
ConvertMetafilesToPng { get; set; } | Gets or sets whether to convert metafile(Wmf or Emf) images to Png image format. |
ConvertShapeToOfficeMath { get; set; } | Gets or sets whether to convert shapes with EquationXML to Office Math objects. |
DetectHyperlinks { get; set; } | Specifies either to detect hyperlinks in text. The default value is false . |
DetectNumberingWithWhitespaces { get; set; } | Allows to specify how numbered list items are recognized when document is imported from plain text format. The default value is true . |
DocumentDirection { get; set; } | Gets or sets a document direction. The default value is LeftToRight. |
Encoding { get; set; } | Gets or sets the encoding that will be used to load an HTML, TXT, or CHM document if the encoding is not specified inside the document. Can be null . Default is null . |
FontSettings { get; set; } | Allows to specify document font settings. |
IgnoreOleData { get; set; } | Specifies whether to ignore the OLE data. |
LanguagePreferences { get; } | Gets language preferences that will be used when document is loading. |
LeadingSpacesOptions { get; set; } | Gets or sets preferred option of a leading space handling. Default value is ConvertToIndent. |
LoadFormat { get; set; } | Specifies the format of the document to be loaded. Default is Auto. |
MswVersion { get; set; } | Allows to specify that the document loading process should match a specific MS Word version. Default value is Word2019 |
Password { get; set; } | Gets or sets the password for opening an encrypted document. Can be null or empty string. Default is null . |
PreserveIncludePictureField { get; set; } | Gets or sets whether to preserve the INCLUDEPICTURE field when reading Microsoft Word formats. The default value is false . |
ProgressCallback { get; set; } | Called during loading a document and accepts data about loading progress. |
ResourceLoadingCallback { get; set; } | Allows to control how external resources (images, style sheets) are loaded when a document is imported from HTML, MHTML. |
TempFolder { get; set; } | Allows to use temporary files when reading document. By default this property is null and no temporary files are used. |
TrailingSpacesOptions { get; set; } | Gets or sets preferred option of a trailing space handling. Default value is Trim. |
UpdateDirtyFields { get; set; } | Specifies whether to update the fields with the dirty attribute. |
UseSystemLcid { get; set; } | Gets or sets whether to use LCID value obtained from Windows registry to determine page setup default margins. |
WarningCallback { get; set; } | Called during a load operation, when an issue is detected that might result in data or formatting fidelity loss. |
Methods
Name | Description |
---|---|
override Equals(object) | Determines whether the specified object is equal in value to the current object. |
Examples
Shows how to read and display hyperlinks.
const string inputText = "Some links in TXT:\n" +
"https://www.aspose.com/\n" +
"https://docs.aspose.com/words/net/\n";
using (Stream stream = new MemoryStream())
{
byte[] buf = Encoding.ASCII.GetBytes(inputText);
stream.Write(buf, 0, buf.Length);
// Load document with hyperlinks.
Document doc = new Document(stream, new TxtLoadOptions() { DetectHyperlinks = true });
// Print hyperlinks text.
foreach (Field field in doc.Range.Fields)
Console.WriteLine(field.Result);
Assert.AreEqual(doc.Range.Fields[0].Result.Trim(), "https://www.aspose.com/");
Assert.AreEqual(doc.Range.Fields[1].Result.Trim(), "https://docs.aspose.com/words/net/");
}
See Also
- class LoadOptions
- namespace Aspose.Words.Loading
- assembly Aspose.Words