Cambiar el tipo de destino del enlace HTML
Aspose.Cells para Python via NET le permite cambiar el tipo de destino de enlaces HTML. El enlace HTML se ve 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.link_target_type. 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.link_target_type. Cambia el tipo de destino del enlace a BLANK. Por defecto, es el PARENT.
from aspose.cells import HtmlLinkTargetType, HtmlSaveOptions, Workbook | |
# For complete examples and data files, please go to https:# github.com/aspose-cells/Aspose.Cells-for-.NET | |
# The path to the documents directory. | |
dataDir = RunExamples.GetDataDir(".") | |
inputPath = dataDir + "Sample1.xlsx" | |
outputPath = dataDir + "Output.out.html" | |
workbook = Workbook(dataDir + "Sample1.xlsx") | |
opts = HtmlSaveOptions() | |
opts.link_target_type = HtmlLinkTargetType.SELF | |
workbook.save(outputPath, opts) | |
print("File saved: {0}", outputPath) |