java.lang.ObjectLoadOptions
com.aspose.words.HtmlLoadOptions
public class HtmlLoadOptions
Constructor Summary |
---|
HtmlLoadOptions()
Initializes a new instance of this class with default values. |
HtmlLoadOptions(java.lang.String password)
A shortcut to initialize a new instance of this class with the specified password to load an encrypted document. |
HtmlLoadOptions(int loadFormat, java.lang.String password, java.lang.String baseUri)
A shortcut to initialize a new instance of this class with properties set to the specified values. |
Property Getters/Setters Summary | ||
---|---|---|
boolean | getAllowTrailingWhitespaceForListItems() | → inherited from LoadOptions |
void | setAllowTrailingWhitespaceForListItems(boolean value) | |
Allows to specify how numbered list items are recognized when document is imported from plain text format. The default value is true. | ||
java.lang.String | getBaseUri() | → inherited from LoadOptions |
void | setBaseUri(java.lang.String value) | |
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. | ||
java.nio.charset.Charset | getEncoding() | → inherited from LoadOptions |
void | setEncoding(java.nio.charset.Charset value) | |
Gets or sets the encoding that will be used to load an HTML document if the encoding is not specified in HTML. Can be null. Default is null. | ||
FontSettings | getFontSettings() | → inherited from LoadOptions |
void | setFontSettings(FontSettings value) | |
Allows to specify document font settings. | ||
int | getLoadFormat() | → inherited from LoadOptions |
void | setLoadFormat(int value) | |
Specifies the format of the document to be loaded.
Default is |
||
int | getMswVersion() | → inherited from LoadOptions |
void | setMswVersion(int value) | |
Allows to specify that the document loading process should match a specific MS Word version.
Default value is |
||
java.lang.String | getPassword() | → inherited from LoadOptions |
void | setPassword(java.lang.String value) | |
Gets or sets the password for opening an encrypted document. Can be null or empty string. Default is null. | ||
boolean | getPreserveIncludePictureField() | → inherited from LoadOptions |
void | setPreserveIncludePictureField(boolean value) | |
Gets or sets whether to preserve the INCLUDEPICTURE field when reading Microsoft Word formats. The default value is false. | ||
IResourceLoadingCallback | getResourceLoadingCallback() | → inherited from LoadOptions |
void | setResourceLoadingCallback(IResourceLoadingCallback value) | |
Allows to control how external resources (images, style sheets) are loaded when a document is imported from HTML, MHTML. | ||
boolean | getSupportVml() | |
void | setSupportVml(boolean value) | |
Specifies HTML parser to parse conditional comments exactly like <!--[if gte vml 1]> and not to parse conditional comments exactly like <![if !vml]>. | ||
IWarningCallback | getWarningCallback() | → inherited from LoadOptions |
void | setWarningCallback(IWarningCallback value) | |
Called during a load operation, when an issue is detected that might result in data or formatting fidelity loss. | ||
int | getWebRequestTimeout() | |
void | setWebRequestTimeout(int value) | |
The number of milliseconds to wait before the web request times out. The default value is 100000 milliseconds (100 seconds). |
Constructor Detail |
---|
public HtmlLoadOptions()
public HtmlLoadOptions(java.lang.String password)
password
- The password to open an encrypted document. Can be null or empty string.public HtmlLoadOptions(int loadFormat, java.lang.String password, java.lang.String baseUri)
loadFormat
- A password
- The password to open an encrypted document. Can be null or empty string.baseUri
- The string that will be used to resolve relative URIs to absolute. Can be null or empty string.Property Getters/Setters Detail |
---|
getAllowTrailingWhitespaceForListItems/setAllowTrailingWhitespaceForListItems | → inherited from LoadOptions |
public boolean getAllowTrailingWhitespaceForListItems() / public void setAllowTrailingWhitespaceForListItems(boolean value) |
This property is used only when loading plain text documents.
If set to true, lists recognition algorithm allows list numbers to end with either dot or whitespace character.
If this option is set to false then the list item is only recognized as such if the leading number is ending with dot "." symbol.
getBaseUri/setBaseUri | → inherited from LoadOptions |
public java.lang.String getBaseUri() / public void setBaseUri(java.lang.String value) |
This property is used to resolve relative URIs into absolute in the following cases:
Example:
Opens an HTML document with images from a stream using a base URI.// We are opening this HTML file: // <html> // <body> // <p>Simple file.</p> // <p><img src="Aspose.Words.gif" width="80" height="60"></p> // </body> // </html> String fileName = getMyDir() + "Document.OpenFromStreamWithBaseUri.html"; // Open the stream. InputStream stream = new FileInputStream(fileName); // Open the document. Note the Document constructor detects HTML format automatically. // Pass the URI of the base folder so any images with relative URIs in the HTML document can be found. LoadOptions loadOptions = new LoadOptions(); loadOptions.setBaseUri(getMyDir()); Document doc = new Document(stream, loadOptions); // You can close the stream now, it is no longer needed because the document is in memory. stream.close(); // Save in the DOC format. doc.save(getMyDir() + "Document.OpenFromStreamWithBaseUri Out.doc");
getEncoding/setEncoding | → inherited from LoadOptions |
public java.nio.charset.Charset getEncoding() / public void setEncoding(java.nio.charset.Charset value) |
This property is used only when loading HTML documents.
If encoding is not specified in HTML and this property is null
, then the system will try to
automatically detect the encoding.
getFontSettings/setFontSettings | → inherited from LoadOptions |
public FontSettings getFontSettings() / public void setFontSettings(FontSettings value) |
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
The default value is null.
getLoadFormat/setLoadFormat | → inherited from LoadOptions |
public int getLoadFormat() / public void setLoadFormat(int value) |
It is recommended that you specify the
getMswVersion/setMswVersion | → inherited from LoadOptions |
public int getMswVersion() / public void setMswVersion(int value) |
getPassword/setPassword | → inherited from LoadOptions |
public java.lang.String getPassword() / public void setPassword(java.lang.String value) |
You need to know the password to open an encrypted document. If the document is not encrypted, set this to null or empty string.
getPreserveIncludePictureField/setPreserveIncludePictureField | → inherited from LoadOptions |
public boolean getPreserveIncludePictureField() / public void setPreserveIncludePictureField(boolean value) |
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.
getResourceLoadingCallback/setResourceLoadingCallback | → inherited from LoadOptions |
public IResourceLoadingCallback getResourceLoadingCallback() / public void setResourceLoadingCallback(IResourceLoadingCallback value) |
getSupportVml/setSupportVml | |
public boolean getSupportVml() / public void setSupportVml(boolean value) |
getWarningCallback/setWarningCallback | → inherited from LoadOptions |
public IWarningCallback getWarningCallback() / public void setWarningCallback(IWarningCallback value) |
getWebRequestTimeout/setWebRequestTimeout | |
public int getWebRequestTimeout() / public void setWebRequestTimeout(int value) |