Class ExcelToFoConverter

    • Constructor Detail

      • ExcelToFoConverter

        public ExcelToFoConverter​(Document document)
      • ExcelToFoConverter

        public ExcelToFoConverter​(FoDocumentFacade foDocumentFacade)
    • Method Detail

      • main

        public static void main​(String[] args)
                         throws Exception
        Usage: ExcelToHtmlConverter infile outfile

        Where infile is an input .xls file ( Word 97-2007) which will be rendered as XSL FO into outfile

        Throws:
        Exception
      • process

        public static Document process​(File xlsFile)
                                throws Exception
        Converts Excel file (97-2007) into XSL FO file.
        Parameters:
        xlsFile - file to process
        Returns:
        DOM representation of result XSL FO
        Throws:
        Exception
      • createPageMaster

        protected String createPageMaster​(float tableWidthIn,
                                          String pageMasterName)
      • getPageMarginInches

        public float getPageMarginInches()
      • isEmptyStyle

        protected boolean isEmptyStyle​(CellStyle cellStyle)
        Returns false if cell style by itself (without text, i.e. borders, fill, etc.) worth a mention, true otherwise
        Returns:
        false if cell style by itself (without text, i.e. borders, fill, etc.) worth a mention, true otherwise
      • processCell

        protected boolean processCell​(HSSFWorkbook workbook,
                                      HSSFCell cell,
                                      Element tableCellElement,
                                      int normalWidthPx,
                                      int maxSpannedWidthPx,
                                      float normalHeightPt)
      • processColumnHeaders

        protected void processColumnHeaders​(HSSFSheet sheet,
                                            int maxSheetColumns,
                                            Element table)
      • processDocumentInformation

        protected void processDocumentInformation​(SummaryInformation summaryInformation)
      • processRow

        protected int processRow​(HSSFWorkbook workbook,
                                 CellRangeAddress[][] mergedRanges,
                                 HSSFRow row,
                                 Element tableRowElement)
        Returns:
        maximum 1-base index of column that were rendered, zero if none
      • processRowNumber

        protected Element processRowNumber​(HSSFRow row)
      • processSheet

        protected boolean processSheet​(HSSFWorkbook workbook,
                                       int sheetIndex)
        Process single sheet (as specified by 0-based sheet index)
        Returns:
        true if result were added to FO document, false otherwise
      • processSheetName

        protected void processSheetName​(HSSFSheet sheet,
                                        Element flow)
      • processWorkbook

        public void processWorkbook​(HSSFWorkbook workbook)
      • setPageMarginInches

        public void setPageMarginInches​(float pageMarginInches)