Spire.Office 8.9.2已发布。在该版本中,Spire.Doc公开了 ShapeObject 对象下的 AllowOverlap 和 BehindText 属性;Spire.PDF 新增无需加载文档即可判断是否文档被加密的方法,同时支持打印时设置页边距的功能;Spire.XLS 新增支持添加签名行、获取工作表中的形状以及在打印时自定义纸张尺寸而不缩放内容;Spire.Presentation 支持高亮被取代文本。此外,许多已知问题也在该版本中成功修复。详情请阅读以下内容。
该版本涵盖了最新版的 Spire.Doc,Spire.PDF,Spire.XLS,Spire.Email,Spire.DocViewer, Spire.PDFViewer,Spire.Presentation,Spire.Spreadsheet, Spire.OfficeViewer, Spire.Barcode, Spire.DataExport。
版本信息如下:
- Spire.Doc.dll v11.8.22
- Spire.Pdf.dll v9.9.3
- Spire.XLS.dll v13.8.14
- Spire.Presentation.dll v8.8.4
- Spire.Email.dll v6.8.0
- Spire.DocViewer.Forms.dll v8.7.0
- Spire.PdfViewer.Forms.dll v7.12.0
- Spire.PdfViewer.Asp.dll v7.12.0
- Spire.Spreadsheet.dll v7.4.2
- Spire.OfficeViewer.Forms.dll v8.9.2
- Spire.Barcode.dll v7.2.1
- Spire.DataExport.dll v4.9.0
- Spire.DataExport.ResourceMgr.dll v2.1.0.
https://www.e-iceblue.cn/Downloads/Spire-Office-NET.html
Spire.Doc
新功能:
- 支持转换数学公式到OfficeMathMLCode。
- 支持邮件合并时为图片添加超链接。
- 提升了保存文档的效率。
Document doc = new Document();
doc.LoadFromFile("1.docx");
StringBuilder stringBuilder = new StringBuilder();
foreach (Section section in doc.Sections)
{
foreach (Paragraph par in section.Body.Paragraphs)
{
foreach (DocumentObject obj in par.ChildObjects)
{
OfficeMath omath = obj as OfficeMath;
if (omath == null) continue;
string mathml = omath.ToOfficeMathMLCode();
stringBuilder.Append(mathml);
stringBuilder.Append("\r\n");
}
}
}
File.WriteAllText("1.txt", stringBuilder.ToString());
doc.Close();
Document doc = new Document();
doc.LoadFromFile("Test.docx");
var fieldNames = new string[] { "MyImage" };
var fieldValues = new string[] { "logo.png" };
doc.MailMerge.MergeImageField += new MergeImageFieldEventHandler(MailMerge_MergeImageField);
doc.MailMerge.Execute(fieldNames, fieldValues);
doc.SaveToFile("result.docx", FileFormat.Docx);
}
void MailMerge_MergeImageField(object sender, MergeImageFieldEventArgs field)
{
string filePath = field.FieldValue as string;
if (!string.IsNullOrEmpty(filePath))
{
field.Image = Image.FromFile(filePath);
field.ImageLink = "https://www.e-iceblue.com/";
}
}
问题修复:
- 修复了加载Word文档时报错程序抛System.InvalidOperationException异常的问题。
- 修复了转换Word到PDF时分页不一致的问题。
- 修复了转换Word到PDF时报错程序抛System.NullReferenceException异常的问题。
- 修复了将从语雀导出的Docx文件转换成HTML文件失败的问题。
- 修复了添加页码域之后不能自动更新域的问题。
- 修复了转换HTML到Doc时后列表字符显示不正确的问题。
- 修复了转换HTML到Doc时换行标签无效的问题。
- 修复了转换Docx到PDF时logo丢失的问题。
- 修复了加载RTF文档报错程序抛System.NullReferenceException异常的问题。
- 修复了Latex公式中符号“~”解析不正确的问题。
- 修复了转换Word到PDF时TOC在多个页面上被分割的问题。
- 修复了转换Docx到HTML时图片不清晰的问题。
- 修复了转换Word到PDF时多出文本的问题。
- 修复了加载文档另存为新文档后内容不一致的问题。
- 修复了添加HTML字符串时程序悬挂的问题。
- 修复了在.NET 7.0项目中所生成的结果文档的内容布局不正确的问题。
Spire.PDF
新功能:
- 新增无需加载文档即可判断是否文档被加密的方法。
- 支持打印时设置页边距的功能。
bool value = PdfDocument.IsPasswordProtected("1.pdf");
pdf.PrintSettings.SelectMultiPageLayout(2,2,false,Spire.Pdf.Print.PdfMultiPageOrder.Horizontal, marginValue)
问题修复:
- 修复了创建overlay后,结果文档在Adobe中打开报错的问题。
- 修复了解密PDF文档后,水印被改变的问题。
- 修复了在PDF中查找跨行文本失败的问题。
- 修复了设置PdfHtmlLayoutFormat下的FitToPage以及FitToHTML属性不生效的问题。
- 修复了多次打印同一个PDF文档,打印输出文件增大以及打印耗时增多的问题。
- 修复了双面打印时,内容方向错误的问题。
- 修复了为PDF文档添加附件时,程序抛出“System.NullReferenceException”异常的问题。
- 修复了转换PDF到Excel时一些单元格被拆分为两列的问题。
- 修复了查找文本时设置WholeWord属性导致高亮文本失败的问题。
- 修复了转换PDF到Word时丢失文本的问题。
- 修复了给PDF文件添加xml附件后结果文件中xml文件打开失败的问题。
- 修复了加载被压缩后的文档时程序抛异常“System.ArgumentOutOfRangeException”的问题。
- 修复了用PDF阅读器打开被压缩后的文档失败的问题。
- 修复了设置了权限密码(不允许内容拷贝和页面提取)的PDF转换到Word时并没有请求输入权限密码的问题。
- 修复了转换PDF到POSTSCRIPT时字符显示不正确的问题。
- 修复了转换OFD到PDF和图片时印章丢失的问题。
- 修复了转换PDF到PDFA内容乱码的问题。
- 修复了绘制表格时程序抛出异常“System.IndexOutOfRangeException“的问题。
Spire.XLS
新功能:
- 支持在打印时自定义纸张尺寸而不缩放内容。
- 支持添加签名行。
- 支持获取工作表中的形状。
sheet.PageSetup.SetCustomPaperSize(224, (float)25.4);
sheet.PageSetup.Orientation = PageOrientationType.Portrait;
sheet.Range["A1"].AddSignatureLine("冰蓝科技","E-iceblue","123 @123.com", "description" ,false, true);
Spire.Xls.Core.IShapes shapes = sheet.Shapes;
问题修复:
- 修复了在西班牙语环境下创建HIPERVINCULO公式,程序抛异常的问题。
- 修复了在加载由新版WPS创建的Excel文档时抛“NullReferenceException”的问题。
- 修复了保存Excel后切片器丢失的问题。
- 修复了拆分文档后,结果文档打开弹出内容有问题。
- 修复了合并多个Excel文档程序抛“NullReferenceException”的问题。
- 修复了在加载Excel文档程序抛“NullReferenceException”的问题。
Spire.Presentation
新功能:
- 支持高亮被取代文本。
Presentation ppt = new Presentation();
ppt.LoadFromFile("input.pptx");
DefaultTextRangeProperties format = new DefaultTextRangeProperties();
format.IsBold = TriState.True;
format.Fill.FillType = Spire.Presentation.Drawing.FillFormatType.Solid;
format.Fill.SolidColor.Color = Color.Red;
format.FontHeight = 25;
ppt.ReplaceAndFormatText("Yuma", "AAAA", format);
ppt.SaveToFile("output.pptx",FileFormat.Pptx2016);
问题修复:
- 修复了拆分包含 think-cell 对象的PPT文档时丢失 think-cell 对象的问题。
- 修复了复制包含现代注释内容的PPT页面失败的问题。
- 修复了获取泪滴形状的点时程序抛出System.IndexOutOfRangeException异常的问题。
- 修复了改变超链接颜色后转换为PDF时颜色未生效的问题。
Spire.DocViewer
问题修复:
- 修复了预览Word文档时图片位置不正确的问题。
Spire.PDFViewer
问题修复:
- 修复了加载PDF文件时,应用程序抛出“System.ArgumentNullException”的问题。
- 修复了加载PDF文件时,应用程序抛出“System.OutOfMemoryException”的问题。