Modifica il Tipo di Destinazione del Link HTML
Aspose.Cells ti permette di cambiare il tipo di destinazione del link HTML. Il link HTML appare così
<a href="http://www.aspose.com/" target="_self">
Come puoi vedere, l’attributo di destinazione nel link HTML sopra è _self. È possibile controllare questo attributo di destinazione utilizzando la proprietà HtmlSaveOptions.LinkTargetType. Questa proprietà richiede l’enum HtmlLinkTargetType che ha i seguenti valori.
- HtmlLinkTargetType.Blank
- HtmlLinkTargetType.Parent
- HtmlLinkTargetType.Self
- HtmlLinkTargetType.Top
Il seguente codice illustra l’uso della proprietà HtmlSaveOptions.LinkTargetType. Cambia il tipo di destinazione del link a blank. Per default, è parent.
// 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); |