Cambiar el tipo de destino del enlace HTML
Aspose.Cells te permite cambiar el tipo de destino del enlace HTML. El enlace HTML luce así
<a href="http://www.aspose.com/" target="_self">
Como puedes ver, el atributo destino en el enlace HTML anterior es _self. Puedes controlar este atributo de destino usando la propiedad HtmlSaveOptions.LinkTargetType. Esta propiedad toma la enumeración HtmlLinkTargetType que tiene los siguientes valores.
- HtmlLinkTargetType.Blank
- HtmlLinkTargetType.Parent
- HtmlLinkTargetType.Self
- HtmlLinkTargetType.Top
El siguiente código ilustra el uso de la propiedad HtmlSaveOptions.LinkTargetType. Cambia el tipo de destino del enlace a blank. Por defecto, es 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); |