Class ChmLoadOptions
Namespace: Aspose.Words.Loading
Assembly: Aspose.Words.dll (25.12.0)
Allows to specify additional options when loading CHM document into a Aspose.Words.Document object.
To learn more, visit the Specify Load Options documentation article.
public class ChmLoadOptions : LoadOptionsInheritance
object ← LoadOptions ← ChmLoadOptions
Inherited Members
LoadOptions.Equals(object) , LoadOptions.LoadFormat , LoadOptions.Password , LoadOptions.BaseUri , LoadOptions.Encoding , LoadOptions.ResourceLoadingCallback , LoadOptions.WarningCallback , LoadOptions.ProgressCallback , LoadOptions.PreserveIncludePictureField , LoadOptions.ConvertShapeToOfficeMath , LoadOptions.FontSettings , LoadOptions.TempFolder , LoadOptions.ConvertMetafilesToPng , LoadOptions.MswVersion , LoadOptions.UpdateDirtyFields , LoadOptions.IgnoreOleData , LoadOptions.UseSystemLcid , LoadOptions.LanguagePreferences , LoadOptions.RecoveryMode , object.GetType() , object.MemberwiseClone() , object.ToString() , object.Equals(object?) , object.Equals(object?, object?) , object.ReferenceEquals(object?, object?) , object.GetHashCode()
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 { OriginalFileName = "amhelp.chm" };
Document doc = new Document(new MemoryStream(File.ReadAllBytes(MyDir + "Document with ms-its links.chm")),
loadOptions);
doc.Save(ArtifactsDir + "ExChmLoadOptions.OriginalFileName.html");Constructors
ChmLoadOptions()
Initializes a new instance of this class with default values.
public 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 { OriginalFileName = "amhelp.chm" };
Document doc = new Document(new MemoryStream(File.ReadAllBytes(MyDir + "Document with ms-its links.chm")),
loadOptions);
doc.Save(ArtifactsDir + "ExChmLoadOptions.OriginalFileName.html");Properties
OriginalFileName
The name of the CHM file.
Default value is null.
public string OriginalFileName { get; set; }Property Value
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 { OriginalFileName = "amhelp.chm" };
Document doc = new Document(new MemoryStream(File.ReadAllBytes(MyDir + "Document with ms-its links.chm")),
loadOptions);
doc.Save(ArtifactsDir + "ExChmLoadOptions.OriginalFileName.html");Remarks
CHM documents may contain links that reference the same document by file name. Aspose.Words supports such links and normally uses Aspose.Words.Document.OriginalFileName 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 Aspose.Words.Document.OriginalFileName.