TxtLoadOptions class
TxtLoadOptions class
Allows to specify additional options when loading LoadFormat.Text document into a Document object. To learn more, visit the Specify Load Options documentation article.
Inheritance: TxtLoadOptions → LoadOptions
Constructors
Name | Description |
---|---|
TxtLoadOptions() | Initializes a new instance of this class with default values. |
Properties
Name | Description |
---|---|
autoNumberingDetection | Gets or sets a boolean value indicating either automatic numbering detection will be performed while loading a document. The default value is true . |
baseUri | 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 .(Inherited from LoadOptions) |
convertMetafilesToPng | Gets or sets whether to convert metafile(Wmf or Emf) images to Png image format. (Inherited from LoadOptions) |
convertShapeToOfficeMath | Gets or sets whether to convert shapes with EquationXML to Office Math objects. (Inherited from LoadOptions) |
detectHyperlinks | Specifies either to detect hyperlinks in text. The default value is false . |
detectNumberingWithWhitespaces | Allows to specify how numbered list items are recognized when document is imported from plain text format. The default value is true . |
documentDirection | Gets or sets a document direction. The default value is DocumentDirection.LeftToRight. |
encoding | 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 .(Inherited from LoadOptions) |
fontSettings | Allows to specify document font settings. (Inherited from LoadOptions) |
ignoreOleData | Specifies whether to ignore the OLE data. (Inherited from LoadOptions) |
languagePreferences | Gets language preferences that will be used when document is loading. (Inherited from LoadOptions) |
leadingSpacesOptions | Gets or sets preferred option of a leading space handling. Default value is TxtLeadingSpacesOptions.ConvertToIndent. |
loadFormat | Specifies the format of the document to be loaded. Default is LoadFormat.Auto. (Inherited from LoadOptions) |
mswVersion | Allows to specify that the document loading process should match a specific MS Word version. Default value is MsWordVersion.Word2019 (Inherited from LoadOptions) |
password | Gets or sets the password for opening an encrypted document. Can be null or empty string. Default is null .(Inherited from LoadOptions) |
preserveIncludePictureField | Gets or sets whether to preserve the INCLUDEPICTURE field when reading Microsoft Word formats. The default value is false .(Inherited from LoadOptions) |
recoveryMode | Defines how the document should be handled if errors occur during loading. Use this property to specify whether the system should attempt to recover the document or follow another defined behavior. The default value is DocumentRecoveryMode.TryRecover. (Inherited from LoadOptions) |
resourceLoadingCallback | Allows to control how external resources (images, style sheets) are loaded when a document is imported from HTML, MHTML. (Inherited from LoadOptions) |
tempFolder | Allows to use temporary files when reading document. By default this property is null and no temporary files are used.(Inherited from LoadOptions) |
trailingSpacesOptions | Gets or sets preferred option of a trailing space handling. Default value is TxtTrailingSpacesOptions.Trim. |
updateDirtyFields | Specifies whether to update the fields with the dirty attribute.(Inherited from LoadOptions) |
useSystemLcid | Gets or sets whether to use LCID value obtained from Windows registry to determine page setup default margins. (Inherited from LoadOptions) |
Examples
Shows how to read and display hyperlinks.
const inputText = "Some links in TXT:\n" +
"https://www.aspose.com/\n" +
"https://docs.aspose.com/words/net/\n";
// Load document with hyperlinks.
let loadOptions = new aw.Loading.TxtLoadOptions();
loadOptions.detectHyperlinks = true;
let doc = new aw.Document(Buffer.from(inputText), loadOptions);
// Print hyperlinks text.
for (let field of doc.range.fields)
console.log(field.result);
expect(doc.range.fields.at(0).result.trim()).toEqual("https://www.aspose.com/");
expect(doc.range.fields.at(1).result.trim()).toEqual("https://docs.aspose.com/words/net/");
See Also
- module Aspose.Words.Loading
- class LoadOptions