Spire.XLS

Spire.XLS 9.7 supports applying external font file to chart and enhances conversions from excel to PDF and Html

We are pleased to announce the release of Spire.XLS 9.7. This version adds two new features, including applying external font file to chart and specifying EmfType in ToEMFStream method. Moreover, some issues that occurred when converting Excel to PDF/HTML, .XLT to .XLS, copying worksheet and getting the formula of trend line are fixed successfully. See the content below for more details.

New Features:

  • Supports applying external font file to chart, such as axis labels and data labels. Note: embedding the font in Excel file is not supported, but it is supported when converting to PDF.
  • Workbook wb = new Workbook();
    wb.LoadFromFile("Book1.xlsx");
    Worksheet sheet = wb.Worksheets[0];
    Chart chart = sheet.Charts[0];
    
    wb.CustomFontFilePaths = new string[] { "C:\\gotham-book.ttf" };
    System.Collections.Hashtable result=wb.GetCustomFontParsedResult();
    chart.PrimaryValueAxis.Font.FontName= result["C:\\gotham-book.ttf"] as string;
    chart.SecondaryCategoryAxis.Font.FontName = result["C:\\gotham-book.ttf"] as string;
    
    Spire.Xls.Charts.ChartSerie cs1 = chart.Series[0];
    cs1.DataPoints.DefaultDataPoint.DataLabels.FontName = result["C:\\gotham-book.ttf"] as string;
    
    wb.SaveToFile("result.pdf", FileFormat.PDF);
    
  • Supports specifying EmfType in ToEMFStream method.
  • sheet.ToEMFStream(stream, sheet.FirstRow, sheet.FirstColumn, sheet.LastRow, sheet.LastColumn, EmfType.EmfOnly);
    

Bug Fixes:

  • Fixes the issue that incorrect content format was caused after converting Excel to HTML.
  • Fixes the issue that the application threw an exception when converting an Excel which contains formulas to PDF.
  • Fixes the issue that incorrect content was caused after copying a sheet which contains named ranges.
  • Fixes the issue that the application threw an exception "offset and length beyond the array bounds..." when loading Excel.
  • Fixed the issue that after creating a chart using an array with an empty first value, the generated Excel prompted an error when opening.
  • Fixes the issue that getting the formula of trendline returned incorrect data.
  • Fixes the issue that incorrect color was caused after converting .XLT to .XLS.
  • Fixes the issue that an exception "The ' [ '- unterminated [] set is being analyzed" was caused when converting Excel to PDF.

Click the link to download Spire.XLS 9.7:
More information of Spire.XLS new release or hotfix: