RtfLoadOptions class

RtfLoadOptions class

Allows to specify additional options when loading LoadFormat.Rtf document into a Document object. To learn more, visit the Specify Load Options documentation article.

Inheritance: RtfLoadOptionsLoadOptions

Constructors

NameDescription
RtfLoadOptions()Initializes a new instance of this class with default values.

Properties

NameDescription
baseUriGets 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)
convertMetafilesToPngGets or sets whether to convert metafile(Wmf or Emf) images to Png image format.
(Inherited from LoadOptions)
convertShapeToOfficeMathGets or sets whether to convert shapes with EquationXML to Office Math objects.
(Inherited from LoadOptions)
encodingGets 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)
fontSettingsAllows to specify document font settings.
(Inherited from LoadOptions)
ignoreOleDataSpecifies whether to ignore the OLE data.
(Inherited from LoadOptions)
languagePreferencesGets language preferences that will be used when document is loading.
(Inherited from LoadOptions)
loadFormatSpecifies the format of the document to be loaded. Default is LoadFormat.Auto.
(Inherited from LoadOptions)
mswVersionAllows to specify that the document loading process should match a specific MS Word version. Default value is MsWordVersion.Word2019
(Inherited from LoadOptions)
passwordGets or sets the password for opening an encrypted document. Can be null or empty string. Default is null.
(Inherited from LoadOptions)
preserveIncludePictureFieldGets or sets whether to preserve the INCLUDEPICTURE field when reading Microsoft Word formats. The default value is false.
(Inherited from LoadOptions)
recognizeUtf8TextWhen set to true, will try to detect UTF8 characters, they will be preserved during import.
resourceLoadingCallbackAllows to control how external resources (images, style sheets) are loaded when a document is imported from HTML, MHTML.
(Inherited from LoadOptions)
tempFolderAllows to use temporary files when reading document. By default this property is null and no temporary files are used.
(Inherited from LoadOptions)
updateDirtyFieldsSpecifies whether to update the fields with the dirty attribute.
(Inherited from LoadOptions)
useSystemLcidGets or sets whether to use LCID value obtained from Windows registry to determine page setup default margins.
(Inherited from LoadOptions)

Examples

Shows how to detect UTF-8 characters while loading an RTF document.

// Create an "RtfLoadOptions" object to modify how we load an RTF document.
let loadOptions = new aw.Loading.RtfLoadOptions();

// Set the "RecognizeUtf8Text" property to "false" to assume that the document uses the ISO 8859-1 charset
// and loads every character in the document.
// Set the "RecognizeUtf8Text" property to "true" to parse any variable-length characters that may occur in the text.
loadOptions.recognizeUtf8Text = recognizeUtf8Text;

let doc = new aw.Document(base.myDir + "UTF-8 characters.rtf", loadOptions);

expect(doc.firstSection.body.getText().trim()).toEqual(recognizeUtf8Text
  ? "“John Doe´s list of currency symbols”™\r€, ¢, £, ¥, ¤"
  : "“John Doe´s list of currency symbolsâ€\u009dâ„¢\r€, ¢, £, Â¥, ¤");

See Also