@Beta public class ExcelToHtmlConverter extends AbstractExcelConverter
_formatter
Constructor and Description |
---|
ExcelToHtmlConverter(Document doc) |
ExcelToHtmlConverter(HtmlDocumentFacade htmlDocumentFacade) |
Modifier and Type | Method and Description |
---|---|
protected String |
buildStyle(HSSFWorkbook workbook,
HSSFCellStyle cellStyle) |
String |
getCssClassPrefixCell() |
String |
getCssClassPrefixDiv() |
String |
getCssClassPrefixRow() |
String |
getCssClassPrefixTable() |
Document |
getDocument() |
protected String |
getStyleClassName(HSSFWorkbook workbook,
HSSFCellStyle cellStyle) |
boolean |
isUseDivsToSpan() |
static void |
main(String[] args)
Java main() interface to interact with
ExcelToHtmlConverter |
static Document |
process(File xlsFile)
Converts Excel file (97-2007) into HTML file.
|
protected boolean |
processCell(HSSFCell cell,
Element tableCellElement,
int normalWidthPx,
int maxSpannedWidthPx,
float normalHeightPt) |
protected void |
processColumnHeaders(HSSFSheet sheet,
int maxSheetColumns,
Element table) |
protected void |
processColumnWidths(HSSFSheet sheet,
int maxSheetColumns,
Element table)
Creates COLGROUP element with width specified for all columns.
|
protected void |
processDocumentInformation(SummaryInformation summaryInformation) |
protected int |
processRow(CellRangeAddress[][] mergedRanges,
HSSFRow row,
Element tableRowElement) |
protected void |
processRowNumber(HSSFRow row,
Element tableRowNumberCellElement) |
protected void |
processSheet(HSSFSheet sheet) |
protected void |
processSheetHeader(Element htmlBody,
HSSFSheet sheet) |
void |
processWorkbook(HSSFWorkbook workbook) |
void |
setCssClassPrefixCell(String cssClassPrefixCell) |
void |
setCssClassPrefixDiv(String cssClassPrefixDiv) |
void |
setCssClassPrefixRow(String cssClassPrefixRow) |
void |
setCssClassPrefixTable(String cssClassPrefixTable) |
void |
setUseDivsToSpan(boolean useDivsToSpan)
Allows converter to wrap content into two additional DIVs with tricky
styles, so it will wrap across empty cells (like in Excel).
|
getColumnName, getColumnWidth, getDefaultColumnWidth, getFontReplacer, getRowName, isOutputColumnHeaders, isOutputHiddenColumns, isOutputHiddenRows, isOutputLeadingSpacesAsNonBreaking, isOutputRowNumbers, isTextEmpty, setFontReplacer, setOutputColumnHeaders, setOutputHiddenColumns, setOutputHiddenRows, setOutputLeadingSpacesAsNonBreaking, setOutputRowNumbers
public ExcelToHtmlConverter(Document doc)
public ExcelToHtmlConverter(HtmlDocumentFacade htmlDocumentFacade)
public static void main(String[] args)
ExcelToHtmlConverter
Usage: ExcelToHtmlConverter infile outfile
Where infile is an input .xls file ( Word 97-2007) which will be rendered as HTML into outfilepublic static Document process(File xlsFile) throws Exception
xlsFile
- file to processException
protected String buildStyle(HSSFWorkbook workbook, HSSFCellStyle cellStyle)
public String getCssClassPrefixCell()
public String getCssClassPrefixDiv()
public String getCssClassPrefixRow()
public String getCssClassPrefixTable()
public Document getDocument()
getDocument
in class AbstractExcelConverter
protected String getStyleClassName(HSSFWorkbook workbook, HSSFCellStyle cellStyle)
public boolean isUseDivsToSpan()
protected boolean processCell(HSSFCell cell, Element tableCellElement, int normalWidthPx, int maxSpannedWidthPx, float normalHeightPt)
protected void processColumnHeaders(HSSFSheet sheet, int maxSheetColumns, Element table)
protected void processColumnWidths(HSSFSheet sheet, int maxSheetColumns, Element table)
AbstractExcelConverter.isOutputRowNumbers()
==true)protected void processDocumentInformation(SummaryInformation summaryInformation)
protected int processRow(CellRangeAddress[][] mergedRanges, HSSFRow row, Element tableRowElement)
protected void processSheet(HSSFSheet sheet)
public void processWorkbook(HSSFWorkbook workbook)
public void setCssClassPrefixCell(String cssClassPrefixCell)
public void setCssClassPrefixDiv(String cssClassPrefixDiv)
public void setCssClassPrefixRow(String cssClassPrefixRow)
public void setCssClassPrefixTable(String cssClassPrefixTable)
public void setUseDivsToSpan(boolean useDivsToSpan)
Warning: after enabling this mode do not serialize result HTML with INDENT=YES option, because line breaks will make additional (unwanted) changes
Copyright © 2020. All rights reserved.