我们很高兴宣布 Spire.Office 11.2.0 正式发布。在此版本中,Spire.Doc 支持在表格中隐藏行;Spire.XLS 支持 LET 和 MAP 函数;Spire.PDF 支持在 PDF 页面中替换文本时设置文本颜色;Spire.Presentation 强化了从 PowerPoint 转 PDF 的功能。同时,修复了大量已知问题。
此版本包含最新的 Spire.Doc、Spire.PDF、Spire.XLS、Spire.Presentation、Spire.Barcode、Spire.DocViewer、Spire.PDFViewer、Spire.Email、Spire.Spreadsheet 以及 Spire.OfficeViewer。
版本信息如下:
- Spire.Doc.dll v14.2.7
- Spire.PDF.dll v12.2.14
- Spire.XLS.dll v16.2.4
- Spire.Presentation.dll v11.2.1
- Spire.Barcode.dll v7.5.0
- Spire.Email.dll v6.8.0
- Spire.DocViewer.Forms.dll v8.9.5
- Spire.PdfViewer.Asp.dll v8.2.9
- Spire.PdfViewer.Forms.dll v8.2.9
- Spire.Spreadsheet.dll v7.5.3
- Spire.OfficeViewer.Forms.dll v8.8.1
获取Spire.Office 11.2.0,请点击:
https://www.e-iceblue.cn/Downloads/Spire-Office-NET.html
Spire.Doc
新功能:
- 新增支持隐藏表格行。
Spire.Doc.Document doc = new Spire.Doc.Document();
doc.LoadFromFile(inputFile1);TableRow row = doc.FirstSection.Body.Tables[0].FirstRow;
row.Hidden = true;doc.SaveToFile(outputDocxFile1);doc = new Document(outputDocxFile1);
row = doc.FirstSection.Body.Tables[0].FirstRow;
Assert.True(row.Hidden);
foreach (TableCell cell in row.Cells)
{
foreach (Paragraph para in cell.Paragraphs)
{
foreach (ParagraphBase run in para.ChildObjects)
{
if (run is TextRange || run is Break || run is Symbol)
{
Assert.True(run.CharacterFormat.Hidden);
}
}
}
}
调整:
- 移除了模型对象的序列化和反序列化功能,包含以下命名空间和接口:
- 收回接口 IShapeAttrSource。
- 收回ShapeBase 以下公开方法:
Spire.Doc.Interface
IDocumentSerializable
IXDLSAttributeReader
IXDLSAttributeWriter
IXDLSContentReader
IXDLSContentWriter
IXDLSFactory
IXDLSSerializableCollection
Spire.Doc.Documents.XML
DocumentSerializable
DocumentSerializableCollection
XDLSHolder
XDLSReader
public object GetDirectShapeAttr(int key)
public object FetchInheritedShapeAttr(int key)
public object FetchShapeAttr(int key)
public void SetShapeAttr(int key, object value)
public void RemoveShapeAttr(int key)
public object GetDirectShapeAttribute(int key)
public object GetInheritedShapeAttribute(int key)
public object GetShapeAttribute(int key)
public void SetShapeAttribute(int key, object value)
public void RemoveShapeAttribute(int key)
public bool HasKey(int key)
问题修复:
- 修复了 Word 转 PDF 效果不一致的问题。
Spire.XLS
新功能:
- 支持 LET 和 MAP 函数。
Workbook workbook = new Workbook();
Worksheet sheet = workbook.Worksheets[0];
sheet.Range["C1"].Text = "out";
sheet.Range["C2"].Formula = "=LET(x, 5, y, 10, x + y)";
sheet.Range["C3"].Formula = "=LET(a, 1, b, 2, c, 3, d, 4, a+b+c+d)";
sheet.Range["C4"].Formula = "=LET(outer, LET(inner, 5, inner*2), outer+10)";
sheet.Range["C5"].Formula = "=LET(x, 5, y, x*2, z, y+3, z*2)";
sheet.Range["C2"].Formula = "=MAP(A2:A4, LAMBDA(x, x*2))";
sheet.Range["D2"].Formula = "=MAP(A2:A4,LAMBDA(x,x*10+1))";
sheet.Range["A8"].Formula = "=MAP(A2:B4,C2:D4,LAMBDA(x,y,SUM(x,y)))";
问题修复:
- 修复了使用 DataSorter.Sort() 时批注内容未排序的问题。
- 修复了 ConditionalFormats.Remove() 方法未正确生效的问题。
- 修复了 Excel 文件加载并保存后,在 WPS 中打开列宽不一致的问题。
- 修复了 Office 365 Excel 文档转换为 PDF 时图片丢失的问题。
- 修复了合并单元格设置字体大小不生效的问题。
- 修复了 Excel 转 PDF 转换结果不一致的问题。
Spire.Presentation
新问题修复:
- 修复了 PPT 转 SVG,效果不一致的问题。
- 修复了 PPT 转 PDF,多出日志信息的问题。
- 修复了 PPT 转 PDF,图表丢失的问题。
Spire.PDF
优化:
- 优化 netstandard DLLs 压缩功能,提升文件压缩比。
新功能:
- 提供 PdfHatchStyle 接口支持创建 Hatch Brush 画刷。
- 支持在替换 PDF 页面文本时配置文本颜色。
PdfDocument pdf = new PdfDocument();
foreach (PdfHatchStyle type in Enum.GetValues(typeof(PdfHatchStyle)))
{
PdfPageBase page = pdf.Pages.Add();
PdfCanvas canves = page.Canvas;
Color foreColor = Color.FromArgb(255, 255, 255, 0);
Color backColor = Color.FromArgb(255, 78, 167, 46);
page.Canvas.DrawString(type.ToString(), new PdfTrueTypeFont(new System.Drawing.Font("Arial", 16)), new PdfSolidBrush(Color.Black), new PointF(0, 0), true);
PdfHatchBrush brush = new PdfHatchBrush(type, foreColor, backColor);
canves.DrawRectangle(brush, 100, 100, 300, 200);
}
pdf.SaveToFile(output);
pdf.Dispose();
PdfTextReplacer textReplacer = new PdfTextReplacer(page);
textReplacer.Options = textReplaceOptions;
textReplacer.ReplaceAllText("文档", "文件", Color.Red);
问题修复:
- 修复了转换 PDF 到图片时,程序挂起的问题。
- 修复了转换 OFD 到图片时,图章绘制不正确的问题。
- 修复了转换 XPS 到 PDF时,结果效果不正确的问题。
- 修复了 PDF 书签的 destination 被改变的问题。
- 修复了添加的书签位置不正确的问题
- 修复了转换 PDF 到 PDF/A-2B 时,抛出异常 “Invalid font metrics” 的问题。
- 修复了转换 PDF 到 PDF/A-2B 时,抛出异常 “InvalidOperationException” 的问题。
- 修复了转换 OFD 到 PDF 时,程序抛 “Object reference not set to an instance of an object” 的问题。
- 修复了转换 PDF 到图片效果不正确的问题。
- 修复了转换 PDF 到图片时阴影偏移的问题。
- 修复了添加图片到 PDF 时执行速度慢且生成文件体积过大的问题。
- 修复了绘制“MS Gothic”字体到页面时程序抛出 NullReferenceException 异常的问题。







