Modificare il tipo di destinazione del collegamento HTML
Contents
[
Hide
]
Aspose.Cells consente di modificare il tipo di destinazione del collegamento HTML. HTML il collegamento è simile a questo
<a href="http://www.aspose.com/" target="_self">
Come puoi vedere, l’attributo target nel link HTML sopra è _self. Puoi controllare questo attributo di destinazione utilizzando la proprietà HtmlSaveOptions.LinkTargetType. Questa proprietà accetta l’enumerazione HtmlLinkTargetType che ha i seguenti valori.
- HtmlLinkTargetType.Blank
- HtmlLinkTargetType.Parent
- HtmlLinkTargetType.Self
- HtmlLinkTargetType.Top
Il codice seguente illustra l’utilizzo diHtmlSaveOptions.LinkTargetType proprietà. Cambia il tipo di destinazione del collegamento invuoto. Per impostazione predefinita, è ilgenitore.
This file contains 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); |