public class ChmLoadOptions extends LoadOptions
Document object.
To learn more, visit the Specify Load Options documentation article.
Examples:
Shows how to resolve URLs like "ms-its:myfile.chm::/index.htm".
// Our document contains URLs like "ms-its:amhelp.chm::....htm", but it has a different name,
// so file links don't work after saving it to HTML.
// We need to define the original filename in 'ChmLoadOptions' to avoid this behavior.
ChmLoadOptions loadOptions = new ChmLoadOptions(); { loadOptions.setOriginalFileName("amhelp.chm"); }
Document doc = new Document(new ByteArrayInputStream(Files.readAllBytes(Paths.get(getMyDir() + "Document with ms-its links.chm"))),
loadOptions);
doc.save(getArtifactsDir() + "ExChmLoadOptions.OriginalFileName.html");
| Constructor and Description |
|---|
ChmLoadOptions()
Initializes a new instance of this class with default values.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getOriginalFileName()
The name of the CHM file.
|
void |
setOriginalFileName(java.lang.String value)
The name of the CHM file.
|
equals, getBaseUri, getConvertMetafilesToPng, getConvertShapeToOfficeMath, getEncoding, getFontSettings, getIgnoreOleData, getLanguagePreferences, getLoadFormat, getMswVersion, getPassword, getPreserveIncludePictureField, getProgressCallback, getRecoveryMode, getResourceLoadingCallback, getTempFolder, getUpdateDirtyFields, getUseSystemLcid, getWarningCallback, setBaseUri, setConvertMetafilesToPng, setConvertShapeToOfficeMath, setEncoding, setFontSettings, setIgnoreOleData, setLoadFormat, setMswVersion, setPassword, setPreserveIncludePictureField, setProgressCallback, setRecoveryMode, setResourceLoadingCallback, setTempFolder, setUpdateDirtyFields, setUseSystemLcid, setWarningCallbackpublic ChmLoadOptions()
Examples:
Shows how to resolve URLs like "ms-its:myfile.chm::/index.htm".
// Our document contains URLs like "ms-its:amhelp.chm::....htm", but it has a different name,
// so file links don't work after saving it to HTML.
// We need to define the original filename in 'ChmLoadOptions' to avoid this behavior.
ChmLoadOptions loadOptions = new ChmLoadOptions(); { loadOptions.setOriginalFileName("amhelp.chm"); }
Document doc = new Document(new ByteArrayInputStream(Files.readAllBytes(Paths.get(getMyDir() + "Document with ms-its links.chm"))),
loadOptions);
doc.save(getArtifactsDir() + "ExChmLoadOptions.OriginalFileName.html");
public java.lang.String getOriginalFileName()
null.
Remarks:
CHM documents may contain links that reference the same document by file name. Aspose.Words supports such links and normally uses Document.getOriginalFileName() to check whether the file referenced by a link is the file that is being loaded. If a document is loaded from a stream, its original file name should be specified explicitly via this property, since it cannot be determined automatically.
If a CHM document is loaded from a file and a non-null value for this property is specified, the value will take priority over the actual name of the file stored in Document.getOriginalFileName().
Examples:
Shows how to resolve URLs like "ms-its:myfile.chm::/index.htm".
// Our document contains URLs like "ms-its:amhelp.chm::....htm", but it has a different name,
// so file links don't work after saving it to HTML.
// We need to define the original filename in 'ChmLoadOptions' to avoid this behavior.
ChmLoadOptions loadOptions = new ChmLoadOptions(); { loadOptions.setOriginalFileName("amhelp.chm"); }
Document doc = new Document(new ByteArrayInputStream(Files.readAllBytes(Paths.get(getMyDir() + "Document with ms-its links.chm"))),
loadOptions);
doc.save(getArtifactsDir() + "ExChmLoadOptions.OriginalFileName.html");
String value.public void setOriginalFileName(java.lang.String value)
null.
Remarks:
CHM documents may contain links that reference the same document by file name. Aspose.Words supports such links and normally uses Document.getOriginalFileName() to check whether the file referenced by a link is the file that is being loaded. If a document is loaded from a stream, its original file name should be specified explicitly via this property, since it cannot be determined automatically.
If a CHM document is loaded from a file and a non-null value for this property is specified, the value will take priority over the actual name of the file stored in Document.getOriginalFileName().
Examples:
Shows how to resolve URLs like "ms-its:myfile.chm::/index.htm".
// Our document contains URLs like "ms-its:amhelp.chm::....htm", but it has a different name,
// so file links don't work after saving it to HTML.
// We need to define the original filename in 'ChmLoadOptions' to avoid this behavior.
ChmLoadOptions loadOptions = new ChmLoadOptions(); { loadOptions.setOriginalFileName("amhelp.chm"); }
Document doc = new Document(new ByteArrayInputStream(Files.readAllBytes(Paths.get(getMyDir() + "Document with ms-its links.chm"))),
loadOptions);
doc.save(getArtifactsDir() + "ExChmLoadOptions.OriginalFileName.html");
value - The corresponding String value.