spire.office 6.10.3已发布。本次更新带来了一些新的功能,比如:spire.pdf支持转换 pdf 到 doc/docx 时设置文档属性;spire.xls新增了实用图表,比如瀑布图、排列图和直方图等等;spire.presentation支持获取超链接的目标幻灯片。此外,该版本还修复了大量已知的问题。详情请阅读以下内容。
该版本涵盖了最新版的spire.doc, spire.pdf, spire.xls, spire.presentation, spire.email, spire.docviewer, spire.pdfviewer, spire.spreadsheet, spire.officeviewer, spire.dataexport, spire.barcode。
版本信息如下:
- spire.doc.dll v9.10.9
- spire.pdf.dll v7.10.4
- spire.xls.dll v11.10.5
- spire.email.dll v4.7.0
- spire.docviewer.forms.dll v6.8.0
- spire.pdfviewer.forms.dll v6.9.1
- spire.pdfviewer.asp.dll v6.9.1
- spire.presentation.dll v6.10.2
- spire.spreadsheet v5.10.0
- spire.officeviewer.forms.dll v6.10.3
- spire.barcode.dll v5.9.4
- spire.dataexport.dll v4.1.9
- spire.dataexport.resourcemgr.dll v2.1.0
- spire.license.dll v1.4.0
https://www.e-iceblue.cn/downloads/spire-office-net.html
spire.pdf
新功能:
- 支持了转换pdf到doc/docx时设置文档属性的功能
spire.pdf.conversion.pdftodocconverter doc = new spire.pdf.conversion.pdftodocconverter(inputfile);
doc.docxoptions.title = "pdftodocx";
doc.docxoptions.subject = "set document properties.";
doc.docxoptions.tags = "test tags";
doc.docxoptions.categories = "pdf";
doc.docxoptions.commments = "this document just for testing the properties";
doc.docxoptions.authors = "test";
doc.docxoptions.lastsavedby = "/e-iceblue";
doc.docxoptions.revision = (int)7.9;
doc.docxoptions.version = "csharp v4.0";
doc.docxoptions.programname = "spire.pdf for .net";
doc.docxoptions.company = "冰蓝科技";
doc.docxoptions.manager = "测试"
doc.savetodocx(outputfile);
pdfdocument pdf = new pdfdocument();
pdfpagebase page = pdf.pages.add();
pdfpolylineannotation polyline = new pdfpolylineannotation(page, new pointf[] { new pointf(0, 60),
new pointf(30, 45), new pointf(60, 90), new pointf(90, 80) });
polyline.color = color.palevioletred;
polyline.text = "this is a polygon annotation";
polyline.author = "e-iceblue";
polyline.subject = "polygon annotation demo";
polyline.name = "summer";
polyline.border = new pdfannotationborder(1f);
polyline.modifieddate = datetime.now;
page.annotationswidget.add(polyline);
pdf.savetofile(output);
pdfdocument pdf = new pdfdocument();
pdf.loadfromfile(inputpath);
stringbuilder builder = new stringbuilder();
//抽取表格
pdftableextractor extractor = new pdftableextractor(pdf);
pdftable[] tablelists = null;
for (int pageindex = 0; pageindex < pdf.pages.count; pageindex )
{
tablelists = extractor.extracttable(pageindex);
if (tablelists != null && tablelists.length > 0)
{
foreach (pdftable table in tablelists)
{
int row = table.getrowcount();
int column = table.getcolumncount();
for (int i = 0; i < row; i )
{
for (int j = 0; j < column; j )
{
string text = table.gettext(i, j);
builder.append(text " ");
}
builder.append("\r\n");
}
}
}
}
file.writealltext(outputfile, builder.tostring());
问题修复:
- 修复了查找指定文本失败的问题
- 修复了将svg文件添加到pdf中,内容显示不正确的问题(.net core3.0平台)
- 修复了打印pdf程序报错“参数无效”的问题
- 修复了转pdf到svg内容不正确的问题
- 修复了添加图层并删除图层后结果文档大小增大的问题
- 修复了打印pdf内容不正确的问题
- 修复了转换pdf到excel区域文化为葡萄牙语时部分列被隐藏的问题
- 修复了填充域时程序抛nullreferenceexception异常的问题
spire.xls
新功能:
- 支持瀑布图、排列图、直方图、箱型图、树状图、旭日图以及漏斗图
workbook workbook = new workbook();
workbook.loadfromfile("waterfall_sample.xlsx");
var sheet = workbook.worksheets[0];
var officechart = sheet.charts.add();
//set chart type as waterfall
officechart.charttype = excelcharttype.waterfall;
//set data range to the chart from the worksheet
officechart.datarange = sheet["a2:b8"];
//data point settings as total in chart
officechart.series[0].datapoints[3].setastotal = true;
officechart.series[0].datapoints[6].setastotal = true;
//showing the connector lines between data points
officechart.series[0].format.showconnectorlines = true;
//set the chart title
officechart.charttitle = "company profit (in usd)";
//formatting data label and legend option
officechart.series[0].datapoints.defaultdatapoint.datalabels.hasvalue = true;
officechart.series[0].datapoints.defaultdatapoint.datalabels.size = 8;
officechart.legend.position = legendpositiontype.right;
workbook.savetofile("waterfall_chart.xlsx");
workbook workbook = new workbook();
workbook.loadfromfile("pareto_sample.xlsx");
var sheet = workbook.worksheets[0];
var officechart = sheet.charts.add();
//set chart type as pareto
officechart.charttype = excelcharttype.pareto;
//set data range in the worksheet
officechart.datarange = sheet["a2:b8"];
//set category values as bin values
officechart.primarycategoryaxis.isbinningbycategory = true;
officechart.primarycategoryaxis.overflowbinvalue = 5;
officechart.primarycategoryaxis.underflowbinvalue = 1;
//formatting pareto line
officechart.series[0].paretolineformat.lineproperties.color = system.drawing.color.blue;
//gap width settings
officechart.series[0].dataformat.options.gapwidth = 6;
//set the chart title
officechart.charttitle = "expenses";
//hiding the legend
officechart.haslegend = false;
workbook.savetofile("pareto_chart.xlsx");
workbook workbook = new workbook();
workbook.loadfromfile("histogram_sample.xlsx");
var sheet = workbook.worksheets[0];
var officechart = sheet.charts.add();
//set chart type as histogram
officechart.charttype = excelcharttype.histogram;
//set data range in the worksheet
officechart.datarange = sheet["a1:a15"];
//category axis bin settings
officechart.primarycategoryaxis.binwidth = 8;
//gap width settings
officechart.series[0].dataformat.options.gapwidth = 6;
//set the chart title and axis title
officechart.charttitle = "height data";
officechart.primaryvalueaxis.title = "number of students";
officechart.primarycategoryaxis.title = "height";
//hiding the legend
officechart.haslegend = false;
workbook.savetofile("histogram_chart.xlsx");
workbook workbook = new workbook();
workbook.loadfromfile("boxandwhisker_sample.xlsx");
var sheet = workbook.worksheets[0];
var officechart = sheet.charts.add();
//set the chart title
officechart.charttitle = "yearly vehicle sales";
//set chart type as box and whisker
officechart.charttype = excelcharttype.boxandwhisker;
//set data range in the worksheet
officechart.datarange = sheet["a1:e17"];
//box and whisker settings on first series
var seriesa = officechart.series[0];
seriesa.dataformat.showinnerpoints = false;
seriesa.dataformat.showoutlierpoints = true;
seriesa.dataformat.showmeanmarkers = true;
seriesa.dataformat.showmeanline = false;
seriesa.dataformat.quartilecalculationtype = excelquartilecalculation.exclusivemedian;
//box and whisker settings on second series
var seriesb = officechart.series[1];
seriesb.dataformat.showinnerpoints = false;
seriesb.dataformat.showoutlierpoints = true;
seriesb.dataformat.showmeanmarkers = true;
seriesb.dataformat.showmeanline = false;
seriesb.dataformat.quartilecalculationtype = excelquartilecalculation.inclusivemedian;
//box and whisker settings on third series
var seriesc = officechart.series[2];
seriesc.dataformat.showinnerpoints = false;
seriesc.dataformat.showoutlierpoints = true;
seriesc.dataformat.showmeanmarkers = true;
seriesc.dataformat.showmeanline = false;
seriesc.dataformat.quartilecalculationtype = excelquartilecalculation.exclusivemedian;
workbook.savetofile("boxandwhisker_chart.xlsx");
workbook workbook = new workbook();
workbook.loadfromfile("treemap_sample.xlsx");
var sheet = workbook.worksheets[0];
var officechart = sheet.charts.add();
//set chart type as treemap
officechart.charttype = excelcharttype.treemap;
//set data range in the worksheet
officechart.datarange = sheet["a2:c11"];
//set the chart title
officechart.charttitle = "area by countries";
//set the treemap label option
officechart.series[0].dataformat.treemaplabeloption = exceltreemaplabeloption.banner;
//formatting data labels
officechart.series[0].datapoints.defaultdatapoint.datalabels.size = 8;
workbook.savetofile("treemap_chart.xlsx");
workbook workbook = new workbook();
workbook.loadfromfile("sunburst_sample.xlsx");
var sheet = workbook.worksheets[0];
var officechart = sheet.charts.add();
//set chart type as sunburst
officechart.charttype = excelcharttype.sunburst;
//set data range in the worksheet
officechart.datarange = sheet["a1:d16"];
//set the chart title
officechart.charttitle = "sales by annual";
//formatting data labels
officechart.series[0].datapoints.defaultdatapoint.datalabels.size = 8;
//hiding the legend
officechart.haslegend = false;
workbook.savetofile("sunburst_chart.xlsx");
workbook workbook = new workbook();
workbook.loadfromfile("funnel_sample.xlsx");
var sheet = workbook.worksheets[0];
var officechart = sheet.charts.add();
//set chart type as funnel
officechart.charttype = excelcharttype.funnel;
//set data range in the worksheet
officechart.datarange = sheet.range["a1:b6"];
//set the chart title
officechart.charttitle = "funnel";
//formatting the legend and data label option
officechart.haslegend = false;
officechart.series[0].datapoints.defaultdatapoint.datalabels.hasvalue = true;
officechart.series[0].datapoints.defaultdatapoint.datalabels.size = 8;
workbook.savetofile("funnel_chart.xlsx");
问题修复:
- 修复了转换excel到pdf内容不正确的问题
- 修复了加载excel文档程序抛出“invalid legendpositiontype string val”问题
- 修复了读取混合图表类型不正确的问题
- 修复了复制工作表时程序抛system.argumentoutofrangeexception问题
- 修复了转换excel到pdf表头线条丢失的问题
- 修复了加载文档时程序挂起的问题
- 修复了设置图表的误差线的端点不起作用的问题
- 修复了加载html抛异常“cannot read that as a zipfile“的问题
- 修复了保存xlsm文档抛出异常“you cannot write() data for an entry that is a directory”
- 修复了加载文档抛出异常'invalid msolinedashstyle string val'的问题
- 修复了转换excel到pdf时字符丢失的问题
- 修复了转换excel到pdf时抛出异常“object reference is not set to an instance of an object.”的问题
- 修复了添加新的数据后获取到的最大行数和列数不正确的问题
- 修复了加载ods文档时程序挂起的问题
- 修复了设置单元格透明背景色不生效的问题
spire.doc
问题修复:
- 修复了使用正则表达式查找文本,结果不全的问题
- 修复了加载html抛异常“argumentoutofrangeexception”的问题
- 修复了转换word到pdf,存在额外的空白页的问题
- 修复了转换word到pdf,换行不正确的问题
- 修复了转换word到pdf,图片位置改变的问题
- 修复了转换word到pdf文本重叠的问题
- 修复了比较word文档抛异常“collection was modified; enumeration operation may not execute”的问题
- 修复了转换word到pdf抛异常“object reference not set to an instance of an object”的问题
- 修复了获取mergegroupnames时抛异常“object reference not set to an instance of an object”的问题
- 修复了转换word到pdf,泰文字符乱码的问题
- 修复了加载word文档抛异常“zip exception”的问题
spire.presentation
新功能:
- 支持获取超链接的目标幻灯片
presentation ppt = new presentation();
ppt.loadfromfile(inputfile);
iautoshape shape = ppt.slides[1].shapes[0] as iautoshape;
if (shape.click.actiontype == hyperlinkactiontype.gotoslide)
{
islide targetslide = shape.click.targetslide;
console.writeline("index = " targetslide.slidenumber);
}
问题修复:
- 修复了加载保存后ole对象无法打开的问题。
- 修复了转换shape到图片后内容被裁剪的问题。
- 修复了获取文字颜色错误的问题。
- 修复了获取表格内容的字体大小错误的问题。
- 修复了获取图表系列的填充颜色不正确的问题。
- 修复了获取幻灯片切换动作的持续时间不正确的问题。
- 修复了转换ppt公式到图片,部分内容缺失的问题。
spire. spreadsheet
问题修复:
- 修复了文本内容被剪切的问题