TxtLoadOptions
Inheritance: java.lang.Object, com.aspose.words.LoadOptions
public class TxtLoadOptions extends LoadOptions
Allows to specify additional options when loading LoadFormat.TEXT document into a Document object.
To learn more, visit the Specify Load Options documentation article.
Constructors
Constructor | Description |
---|---|
TxtLoadOptions() | Initializes a new instance of this class with default values. |
Methods
Method | Description |
---|---|
equals(Object arg0) | |
getAutoNumberingDetection() | Gets a boolean value indicating either automatic numbering detection will be performed while loading a document. |
getBaseUri() | Gets the string that will be used to resolve relative URIs found in the document into absolute URIs when required. |
getClass() | |
getConvertMetafilesToPng() | Gets whether to convert metafile ( F:Aspose.FileFormat.Wmf or F:Aspose.FileFormat.Emf) images to F:Aspose.FileFormat.Png image format. |
getConvertShapeToOfficeMath() | Gets whether to convert shapes with EquationXML to Office Math objects. |
getDetectNumberingWithWhitespaces() | Allows to specify how numbered list items are recognized when document is imported from plain text format. |
getDocumentDirection() | Gets a document direction. |
getEncoding() | Gets the encoding that will be used to load an HTML, TXT, or CHM document if the encoding is not specified inside the document. |
getFontSettings() | Allows to specify document font settings. |
getIgnoreOleData() | Specifies whether to ignore the OLE data. |
getLanguagePreferences() | Gets language preferences that will be used when document is loading. |
getLeadingSpacesOptions() | Gets preferred option of a leading space handling. |
getLoadFormat() | Specifies the format of the document to be loaded. |
getMswVersion() | Allows to specify that the document loading process should match a specific MS Word version. |
getPassword() | Gets the password for opening an encrypted document. |
getPreserveIncludePictureField() | Gets whether to preserve the INCLUDEPICTURE field when reading Microsoft Word formats. |
getProgressCallback() | Called during loading a document and accepts data about loading progress. |
getResourceLoadingCallback() | Allows to control how external resources (images, style sheets) are loaded when a document is imported from HTML, MHTML. |
getTempFolder() | Allows to use temporary files when reading document. |
getTrailingSpacesOptions() | Gets preferred option of a trailing space handling. |
getUpdateDirtyFields() | Specifies whether to update the fields with the dirty attribute. |
getWarningCallback() | Called during a load operation, when an issue is detected that might result in data or formatting fidelity loss. |
hashCode() | |
notify() | |
notifyAll() | |
setAutoNumberingDetection(boolean value) | Sets a boolean value indicating either automatic numbering detection will be performed while loading a document. |
setBaseUri(String value) | Sets the string that will be used to resolve relative URIs found in the document into absolute URIs when required. |
setConvertMetafilesToPng(boolean value) | Sets whether to convert metafile ( F:Aspose.FileFormat.Wmf or F:Aspose.FileFormat.Emf) images to F:Aspose.FileFormat.Png image format. |
setConvertShapeToOfficeMath(boolean value) | Sets whether to convert shapes with EquationXML to Office Math objects. |
setDetectNumberingWithWhitespaces(boolean value) | Allows to specify how numbered list items are recognized when document is imported from plain text format. |
setDocumentDirection(int value) | Sets a document direction. |
setEncoding(Charset value) | Sets the encoding that will be used to load an HTML, TXT, or CHM document if the encoding is not specified inside the document. |
setFontSettings(FontSettings value) | Allows to specify document font settings. |
setIgnoreOleData(boolean value) | Specifies whether to ignore the OLE data. |
setLeadingSpacesOptions(int value) | Sets preferred option of a leading space handling. |
setLoadFormat(int value) | Specifies the format of the document to be loaded. |
setMswVersion(int value) | Allows to specify that the document loading process should match a specific MS Word version. |
setPassword(String value) | Sets the password for opening an encrypted document. |
setPreserveIncludePictureField(boolean value) | Sets whether to preserve the INCLUDEPICTURE field when reading Microsoft Word formats. |
setProgressCallback(IDocumentLoadingCallback value) | Called during loading a document and accepts data about loading progress. |
setResourceLoadingCallback(IResourceLoadingCallback value) | Allows to control how external resources (images, style sheets) are loaded when a document is imported from HTML, MHTML. |
setTempFolder(String value) | Allows to use temporary files when reading document. |
setTrailingSpacesOptions(int value) | Sets preferred option of a trailing space handling. |
setUpdateDirtyFields(boolean value) | Specifies whether to update the fields with the dirty attribute. |
setWarningCallback(IWarningCallback value) | Called during a load operation, when an issue is detected that might result in data or formatting fidelity loss. |
toString() | |
wait() | |
wait(long arg0) | |
wait(long arg0, int arg1) |
TxtLoadOptions()
public TxtLoadOptions()
Initializes a new instance of this class with default values.
equals(Object arg0)
public boolean equals(Object arg0)
Parameters:
Parameter | Type | Description |
---|---|---|
arg0 | java.lang.Object |
Returns: boolean
getAutoNumberingDetection()
public boolean getAutoNumberingDetection()
Gets a boolean value indicating either automatic numbering detection will be performed while loading a document. The default value is true .
Returns: boolean - A boolean value indicating either automatic numbering detection will be performed while loading a document.
getBaseUri()
public String getBaseUri()
Gets 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 .
This property is used to resolve relative URIs into absolute in the following cases:
- When loading an HTML document from a stream and the document contains images with relative URIs and does not have a base URI specified in the BASE HTML element.
- When saving a document to PDF and other formats, to retrieve images linked using relative URIs so the images can be saved into the output document.
Returns: java.lang.String - The string that will be used to resolve relative URIs found in the document into absolute URIs when required.
getClass()
public final native Class<?> getClass()
Returns: java.lang.Class>
getConvertMetafilesToPng()
public boolean getConvertMetafilesToPng()
Gets whether to convert metafile ( F:Aspose.FileFormat.Wmf or F:Aspose.FileFormat.Emf) images to F:Aspose.FileFormat.Png image format. Metafiles ( F:Aspose.FileFormat.Wmf or F:Aspose.FileFormat.Emf) is an uncompressed image format and sometimes requires to much RAM to hold and process document. This option allows to convert all metafile images to F:Aspose.FileFormat.Png on document loading. Please note - conversion vector graphics to raster decreases quality of the images.
Returns: boolean - Whether to convert metafile ( F:Aspose.FileFormat.Wmf or F:Aspose.FileFormat.Emf) images to F:Aspose.FileFormat.Png image format.
getConvertShapeToOfficeMath()
public boolean getConvertShapeToOfficeMath()
Gets whether to convert shapes with EquationXML to Office Math objects.
Returns: boolean - Whether to convert shapes with EquationXML to Office Math objects.
getDetectNumberingWithWhitespaces()
public boolean getDetectNumberingWithWhitespaces()
Allows to specify how numbered list items are recognized when document is imported from plain text format. The default value is true .
If this option is set to false , lists recognition algorithm detects list paragraphs, when list numbers ends with either dot, right bracket or bullet symbols (such as “\u2022”, “*”, “-” or “o”).
If this option is set to true , whitespaces are also used as list number delimiters: list recognition algorithm for Arabic style numbering (1., 1.1.2.) uses both whitespaces and dot (".") symbols.
Returns: boolean - The corresponding boolean value.
getDocumentDirection()
public int getDocumentDirection()
Gets a document direction. The default value is DocumentDirection.LEFT_TO_RIGHT.
Returns: int - A document direction. The returned value is one of DocumentDirection constants.
getEncoding()
public Charset getEncoding()
Gets 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 .
This property is used only when loading HTML, TXT, or CHM documents.
If encoding is not specified inside the document and this property is null , then the system will try to automatically detect the encoding.
Returns: java.nio.charset.Charset - The encoding that will be used to load an HTML, TXT, or CHM document if the encoding is not specified inside the document.
getFontSettings()
public FontSettings getFontSettings()
Allows to specify document font settings.
When loading some formats, Aspose.Words may require to resolve the fonts. For example, when loading HTML documents Aspose.Words may resolve the fonts to perform font fallback.
If set to null , default static font settings FontSettings.getDefaultInstance() will be used.
The default value is null .
Returns: FontSettings - The corresponding FontSettings value.
getIgnoreOleData()
public boolean getIgnoreOleData()
Specifies whether to ignore the OLE data.
Ignoring OLE data may reduce memory consumption and increase performance without data lost in a case when destination format does not support OLE objects.
The default value is false .
Returns: boolean - The corresponding boolean value.
getLanguagePreferences()
public LanguagePreferences getLanguagePreferences()
Gets language preferences that will be used when document is loading.
Returns: LanguagePreferences - Language preferences that will be used when document is loading.
getLeadingSpacesOptions()
public int getLeadingSpacesOptions()
Gets preferred option of a leading space handling. Default value is TxtLeadingSpacesOptions.CONVERT_TO_INDENT.
Returns: int - Preferred option of a leading space handling. The returned value is one of TxtLeadingSpacesOptions constants.
getLoadFormat()
public int getLoadFormat()
Specifies the format of the document to be loaded. Default is LoadFormat.AUTO.
It is recommended that you specify the LoadFormat.AUTO value and let Aspose.Words detect the file format automatically. If you know the format of the document you are about to load, you can specify the format explicitly and this will slightly reduce the loading time by the overhead associated with auto detecting the format. If you specify an explicit load format and it will turn out to be wrong, the auto detection will be invoked and a second attempt to load the file will be made.
Returns: int - The corresponding int value. The returned value is one of LoadFormat constants.
getMswVersion()
public int getMswVersion()
Allows to specify that the document loading process should match a specific MS Word version. Default value is MsWordVersion.WORD_2019 Different Word versions may handle certain aspects of document content and formatting slightly differently during the loading process, which may result in minor differences in Document Object Model.
Returns: int - The corresponding int value. The returned value is one of MsWordVersion constants.
getPassword()
public String getPassword()
Gets the password for opening an encrypted document. Can be null or empty string. Default is null .
You need to know the password to open an encrypted document. If the document is not encrypted, set this to null or empty string.
Returns: java.lang.String - The password for opening an encrypted document.
getPreserveIncludePictureField()
public boolean getPreserveIncludePictureField()
Gets whether to preserve the INCLUDEPICTURE field when reading Microsoft Word formats. The default value is false .
By default, the INCLUDEPICTURE field is converted into a shape object. You can override that if you need the field to be preserved, for example, if you wish to update it programmatically. Note however that this approach is not common for Aspose.Words. Use it on your own risk.
One of the possible use cases may be using a MERGEFIELD as a child field to dynamically change the source path of the picture. In this case you need the INCLUDEPICTURE to be preserved in the model.
Returns: boolean - Whether to preserve the INCLUDEPICTURE field when reading Microsoft Word formats.
getProgressCallback()
public IDocumentLoadingCallback getProgressCallback()
Called during loading a document and accepts data about loading progress.
LoadFormat.DOCX, LoadFormat.FLAT_OPC, LoadFormat.DOCM, LoadFormat.DOTM, LoadFormat.DOTX, LoadFormat.MARKDOWN, LoadFormat.RTF, LoadFormat.WORD_ML, LoadFormat.DOC, LoadFormat.DOT, LoadFormat.ODT, LoadFormat.OTT formats supported.
Returns: IDocumentLoadingCallback - The corresponding IDocumentLoadingCallback value.
getResourceLoadingCallback()
public IResourceLoadingCallback getResourceLoadingCallback()
Allows to control how external resources (images, style sheets) are loaded when a document is imported from HTML, MHTML.
Returns: IResourceLoadingCallback - The corresponding IResourceLoadingCallback value.
getTempFolder()
public String getTempFolder()
Allows to use temporary files when reading document. By default this property is null and no temporary files are used.
The folder must exist and be writable, otherwise an exception will be thrown.
Aspose.Words automatically deletes all temporary files when reading is complete.
Returns: java.lang.String - The corresponding java.lang.String value.
getTrailingSpacesOptions()
public int getTrailingSpacesOptions()
Gets preferred option of a trailing space handling. Default value is TxtTrailingSpacesOptions.TRIM.
Returns: int - Preferred option of a trailing space handling. The returned value is one of TxtTrailingSpacesOptions constants.
getUpdateDirtyFields()
public boolean getUpdateDirtyFields()
Specifies whether to update the fields with the dirty attribute.
Returns: boolean - The corresponding boolean value.
getWarningCallback()
public IWarningCallback getWarningCallback()
Called during a load operation, when an issue is detected that might result in data or formatting fidelity loss.
Returns: IWarningCallback - The corresponding IWarningCallback value.
hashCode()
public native int hashCode()
Returns: int
notify()
public final native void notify()
notifyAll()
public final native void notifyAll()
setAutoNumberingDetection(boolean value)
public void setAutoNumberingDetection(boolean value)
Sets a boolean value indicating either automatic numbering detection will be performed while loading a document. The default value is true .
Parameters:
Parameter | Type | Description |
---|---|---|
value | boolean | A boolean value indicating either automatic numbering detection will be performed while loading a document. |
setBaseUri(String value)
public void setBaseUri(String value)
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 .
This property is used to resolve relative URIs into absolute in the following cases:
- When loading an HTML document from a stream and the document contains images with relative URIs and does not have a base URI specified in the BASE HTML element.
- When saving a document to PDF and other formats, to retrieve images linked using relative URIs so the images can be saved into the output document.
Parameters:
Parameter | Type | Description |
---|---|---|
value | java.lang.String | The string that will be used to resolve relative URIs found in the document into absolute URIs when required. |
setConvertMetafilesToPng(boolean value)
public void setConvertMetafilesToPng(boolean value)
Sets whether to convert metafile ( F:Aspose.FileFormat.Wmf or F:Aspose.FileFormat.Emf) images to F:Aspose.FileFormat.Png image format. Metafiles ( F:Aspose.FileFormat.Wmf or F:Aspose.FileFormat.Emf) is an uncompressed image format and sometimes requires to much RAM to hold and process document. This option allows to convert all metafile images to F:Aspose.FileFormat.Png on document loading. Please note - conversion vector graphics to raster decreases quality of the images.
Parameters:
Parameter | Type | Description |
---|---|---|
value | boolean | Whether to convert metafile ( F:Aspose.FileFormat.Wmf or F:Aspose.FileFormat.Emf) images to F:Aspose.FileFormat.Png image format. |
setConvertShapeToOfficeMath(boolean value)
public void setConvertShapeToOfficeMath(boolean value)
Sets whether to convert shapes with EquationXML to Office Math objects.
Parameters:
Parameter | Type | Description |
---|---|---|
value | boolean | Whether to convert shapes with EquationXML to Office Math objects. |
setDetectNumberingWithWhitespaces(boolean value)
public void setDetectNumberingWithWhitespaces(boolean value)
Allows to specify how numbered list items are recognized when document is imported from plain text format. The default value is true .
If this option is set to false , lists recognition algorithm detects list paragraphs, when list numbers ends with either dot, right bracket or bullet symbols (such as “\u2022”, “*”, “-” or “o”).
If this option is set to true , whitespaces are also used as list number delimiters: list recognition algorithm for Arabic style numbering (1., 1.1.2.) uses both whitespaces and dot (".") symbols.
Parameters:
Parameter | Type | Description |
---|---|---|
value | boolean | The corresponding boolean value. |
setDocumentDirection(int value)
public void setDocumentDirection(int value)
Sets a document direction. The default value is DocumentDirection.LEFT_TO_RIGHT.
Parameters:
Parameter | Type | Description |
---|---|---|
value | int | A document direction. The value must be one of DocumentDirection constants. |
setEncoding(Charset value)
public void setEncoding(Charset value)
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 .
This property is used only when loading HTML, TXT, or CHM documents.
If encoding is not specified inside the document and this property is null , then the system will try to automatically detect the encoding.
Parameters:
Parameter | Type | Description |
---|---|---|
value | java.nio.charset.Charset | The encoding that will be used to load an HTML, TXT, or CHM document if the encoding is not specified inside the document. |
setFontSettings(FontSettings value)
public void setFontSettings(FontSettings value)
Allows to specify document font settings.
When loading some formats, Aspose.Words may require to resolve the fonts. For example, when loading HTML documents Aspose.Words may resolve the fonts to perform font fallback.
If set to null , default static font settings FontSettings.getDefaultInstance() will be used.
The default value is null .
Parameters:
Parameter | Type | Description |
---|---|---|
value | FontSettings | The corresponding FontSettings value. |
setIgnoreOleData(boolean value)
public void setIgnoreOleData(boolean value)
Specifies whether to ignore the OLE data.
Ignoring OLE data may reduce memory consumption and increase performance without data lost in a case when destination format does not support OLE objects.
The default value is false .
Parameters:
Parameter | Type | Description |
---|---|---|
value | boolean | The corresponding boolean value. |
setLeadingSpacesOptions(int value)
public void setLeadingSpacesOptions(int value)
Sets preferred option of a leading space handling. Default value is TxtLeadingSpacesOptions.CONVERT_TO_INDENT.
Parameters:
Parameter | Type | Description |
---|---|---|
value | int | Preferred option of a leading space handling. The value must be one of TxtLeadingSpacesOptions constants. |
setLoadFormat(int value)
public void setLoadFormat(int value)
Specifies the format of the document to be loaded. Default is LoadFormat.AUTO.
It is recommended that you specify the LoadFormat.AUTO value and let Aspose.Words detect the file format automatically. If you know the format of the document you are about to load, you can specify the format explicitly and this will slightly reduce the loading time by the overhead associated with auto detecting the format. If you specify an explicit load format and it will turn out to be wrong, the auto detection will be invoked and a second attempt to load the file will be made.
Parameters:
Parameter | Type | Description |
---|---|---|
value | int | The corresponding int value. The value must be one of LoadFormat constants. |
setMswVersion(int value)
public void setMswVersion(int value)
Allows to specify that the document loading process should match a specific MS Word version. Default value is MsWordVersion.WORD_2019 Different Word versions may handle certain aspects of document content and formatting slightly differently during the loading process, which may result in minor differences in Document Object Model.
Parameters:
Parameter | Type | Description |
---|---|---|
value | int | The corresponding int value. The value must be one of MsWordVersion constants. |
setPassword(String value)
public void setPassword(String value)
Sets the password for opening an encrypted document. Can be null or empty string. Default is null .
You need to know the password to open an encrypted document. If the document is not encrypted, set this to null or empty string.
Parameters:
Parameter | Type | Description |
---|---|---|
value | java.lang.String | The password for opening an encrypted document. |
setPreserveIncludePictureField(boolean value)
public void setPreserveIncludePictureField(boolean value)
Sets whether to preserve the INCLUDEPICTURE field when reading Microsoft Word formats. The default value is false .
By default, the INCLUDEPICTURE field is converted into a shape object. You can override that if you need the field to be preserved, for example, if you wish to update it programmatically. Note however that this approach is not common for Aspose.Words. Use it on your own risk.
One of the possible use cases may be using a MERGEFIELD as a child field to dynamically change the source path of the picture. In this case you need the INCLUDEPICTURE to be preserved in the model.
Parameters:
Parameter | Type | Description |
---|---|---|
value | boolean | Whether to preserve the INCLUDEPICTURE field when reading Microsoft Word formats. |
setProgressCallback(IDocumentLoadingCallback value)
public void setProgressCallback(IDocumentLoadingCallback value)
Called during loading a document and accepts data about loading progress.
LoadFormat.DOCX, LoadFormat.FLAT_OPC, LoadFormat.DOCM, LoadFormat.DOTM, LoadFormat.DOTX, LoadFormat.MARKDOWN, LoadFormat.RTF, LoadFormat.WORD_ML, LoadFormat.DOC, LoadFormat.DOT, LoadFormat.ODT, LoadFormat.OTT formats supported.
Parameters:
Parameter | Type | Description |
---|---|---|
value | IDocumentLoadingCallback | The corresponding IDocumentLoadingCallback value. |
setResourceLoadingCallback(IResourceLoadingCallback value)
public void setResourceLoadingCallback(IResourceLoadingCallback value)
Allows to control how external resources (images, style sheets) are loaded when a document is imported from HTML, MHTML.
Parameters:
Parameter | Type | Description |
---|---|---|
value | IResourceLoadingCallback | The corresponding IResourceLoadingCallback value. |
setTempFolder(String value)
public void setTempFolder(String value)
Allows to use temporary files when reading document. By default this property is null and no temporary files are used.
The folder must exist and be writable, otherwise an exception will be thrown.
Aspose.Words automatically deletes all temporary files when reading is complete.
Parameters:
Parameter | Type | Description |
---|---|---|
value | java.lang.String | The corresponding java.lang.String value. |
setTrailingSpacesOptions(int value)
public void setTrailingSpacesOptions(int value)
Sets preferred option of a trailing space handling. Default value is TxtTrailingSpacesOptions.TRIM.
Parameters:
Parameter | Type | Description |
---|---|---|
value | int | Preferred option of a trailing space handling. The value must be one of TxtTrailingSpacesOptions constants. |
setUpdateDirtyFields(boolean value)
public void setUpdateDirtyFields(boolean value)
Specifies whether to update the fields with the dirty attribute.
Parameters:
Parameter | Type | Description |
---|---|---|
value | boolean | The corresponding boolean value. |
setWarningCallback(IWarningCallback value)
public void setWarningCallback(IWarningCallback value)
Called during a load operation, when an issue is detected that might result in data or formatting fidelity loss.
Parameters:
Parameter | Type | Description |
---|---|---|
value | IWarningCallback | The corresponding IWarningCallback value. |
toString()
public String toString()
Returns: java.lang.String
wait()
public final void wait()
wait(long arg0)
public final native void wait(long arg0)
Parameters:
Parameter | Type | Description |
---|---|---|
arg0 | long |
wait(long arg0, int arg1)
public final void wait(long arg0, int arg1)
Parameters:
Parameter | Type | Description |
---|---|---|
arg0 | long | |
arg1 | int |