HTML リンク ターゲット タイプの変更
Contents
[
Hide
]
Aspose.Cells では、HTML リンク ターゲット タイプを変更できます。 HTML リンクはこんな感じ
<a href="http://www.aspose.com/" target="_self">
上記の HTML リンクの target 属性は _self です。 HtmlSaveOptions.LinkTargetType プロパティを使用して、このターゲット属性を制御できます。このプロパティは、次の値を持つ HtmlLinkTargetType 列挙型を取ります。
- HtmlLinkTargetType.Blank
- HtmlLinkTargetType.Parent
- HtmlLinkTargetType.Self
- HtmlLinkTargetType.Top
次のコードは、HtmlSaveOptions.LinkTargetType財産。リンクターゲットタイプをに変更します空欄.デフォルトでは、親.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET | |
// The path to the documents directory. | |
string dataDir = RunExamples.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | |
string inputPath = dataDir + "Sample1.xlsx"; | |
string outputPath = dataDir + "Output.out.html"; | |
Workbook workbook = new Workbook(dataDir + "Sample1.xlsx"); | |
HtmlSaveOptions opts = new HtmlSaveOptions(); | |
opts.LinkTargetType = HtmlLinkTargetType.Self; | |
workbook.Save(outputPath, opts); | |
Console.WriteLine("File saved: {0}", outputPath); |