Exportar rango de área de impresión a HTML
Contents
[
Hide
]
Exportar rango de área de impresión a HTML
Aspose.Cells for Python via Java admite exportar solo el área de impresión, es decir, el rango de celdas seleccionado en lugar de todo el ella a HTML. Para esto, el API proporciona elHtmlSaveOptions.ExportPrintAreaOnly propiedad. Estableciendo esta propiedad enVerdadero solo exportará el área de impresión.
El siguiente código de ejemplo demuestra el uso de laHtmlSaveOptions.ExportPrintAreaOnlyproperty para exportar solo el área de impresión al HTML.
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
source_directory = "Examples/SampleFiles/SourceDirectory/" | |
output_directory = "Examples/SampleFiles/OutputDirectory/" | |
# Load the Sample Workbook | |
workbook = Workbook(source_directory + "sampleInlineCharts.xlsx") | |
# Access the firs worksheet | |
worksheet = workbook.getWorksheets().get(0) | |
# Set the print area. | |
worksheet.getPageSetup().setPrintArea("D2:M20") | |
# Initialize HtmlSaveOptions | |
saveOptions = HtmlSaveOptions() | |
# Set flag to export print area only | |
saveOptions.setExportPrintAreaOnly(True) | |
# Save the excel file. | |
workbook.save(output_directory + "outputInlineCharts.html", saveOptions) |