Spire.Office 9.11.0 已发布。在该版本中,Spire.XLS 支持传递值对透视表进行分组;Spire.Presentation 支持在转换 PPT 到 SVG 时设置是否将 SlidePicture 形状保存为图形标签;Spire.PDF 支持返回 PdfTextMarkupAnnotationWidget 的区域数组值。此外,该版本还成功修复了大量已知问题。详情请阅读以下内容。
版本信息如下:
- Spire.DocViewer 8.8.3
- Spire.PDF 10.11.7
- Spire.XLS 14.11.3
- Spire.Doc 12.11.7
- Spire.Presentation 9.11.3
- Spire.PDF 10.11.1
https://www.e-iceblue.cn/Downloads/Spire-Office-NET.html
Spire.XLS
新功能:
- 支持新公式 ACOT、ACOTH、COT、TOROW、TOCOL。
- 支持传递值对透视表进行分组。
Workbook wb = new Workbook();
wb.LoadFromFile(inputFile);
Worksheet pivotSheet = wb.Worksheets[0];
XlsPivotTable pivot = (XlsPivotTable)pivotSheet.PivotTables[0]; PivotField dateBaseField = pivot.PivotFields["number"] as PivotField;
dateBaseField.CreateGroup(3000, 3800, 1);
pivot.CalculateData();
wb.SaveToFile(outputFile);
wb.Dispose();
问题修复:
- 修复了压缩图片后,结果效果不正确的问题。
- 修复了 Excel 转图像,部分内容被隐藏的问题。
- 修复了加载 Excel 文档,程序抛 "ArgumentOutOfRangeException" 错误的问题。
- 修复了加载保存一个 Excel 文档后,图片内容不正确的问题。
- 修复了 Excel 转到 PDF,图表高度不正确的问题。
- 修复了使用 Worksheet.AutoFitColumn 方法,效果不正确的问题。
- 修复了保存 xls 到 xlsx,背景颜色改变的问题。
- 修复了 Excel 转 PDF,内容不正确的问题。
- 修复了替换 Excel 中的图片,效果不正确的问题。
- 修复了图表转图片, 内容不正确的问题。
- 修复了打印 Excel,内容丢失的问题。
- 修复了使用 VLOOKUP() 公式,效果不正确的问题。
- 修复了 Excel 转 PDF, 内容不正确的问题。
Spire.Presentation
新功能:
- 新增 ppt.SaveToSvgOption.ConvertPictureUsingGraphicTag 布尔属性用于在保存 PPT 文档到 SVG 时设置是否将 SlidePicture 形状保存为图形标签。
ppt.SaveToSvgOption.ConvertPictureUsingGraphicTag = true;
问题修复:
- 修复了转换 PPTX 文档到 PDFA 文档时,PDFA 标准不生效的问题。
- 修复了转换 PPTX 文档到 SVG 文件时,文本方向不正确的问题。
- 修复了使用 shape.SaveAsSvgInSlide() 方法转换到 SVG 文档时,背景色不正确的问题。
- 修复了转换幻灯片到 SVG 文档时,文本没有对齐的问题。
- 修复了加载 PPTX 文档时,程序抛出异常 "System.NullReferenceException: Object reference not set to an instance of an object" 的问题。
Spire.PDF
新功能:
- 支持获取 PDF 文档中的视频和音频的功能。
- 支持返回 PdfTextMarkupAnnotationWidget 的区域数组值。
PdfDocument pdf = new PdfDocument();
pdf.LoadFromFile(inputFile);
for (int i = 0; i < pdf.Pages.Count; i++)
{
PdfPageBase page = pdf.Pages[i];
PdfAnnotationCollection ancoll = page.Annotations;
for (int j = 0; j < ancoll.Count; j++)
{
PdfRichMediaAnnotationWidget MediaWidget = ancoll[j] as PdfRichMediaAnnotationWidget;
byte[] data = MediaWidget.RichMediaData;
string embedFileName = MediaWidget.RichMediaName;
File.WriteAllBytes(outputFile + embedFileName,data);
}
}
// Create a PdfDocument object
PdfDocument doc = new PdfDocument();
// Load a PDF file
doc.LoadFromFile(inputFile);
// Initialize a StringBuilder to store extracted text
StringWriter highlightedTextWriter = new StringWriter();
// Loop through each page in the document
foreach (PdfPageBase page in doc.Pages)
{
// Get all annotations on the page
PdfAnnotationCollection annotations = page.Annotations;
// Loop through the annotations
foreach (PdfAnnotation annotation in annotations)
{
// Check if the annotation is a highlight annotation
if (annotation is PdfTextMarkupAnnotationWidget highlightAnnotation)
{
if (highlightAnnotation.TextMarkupAnnotationType == PdfTextMarkupAnnotationType.Highlight)
{
PdfBrush brush = PdfBrushes.Red;
PdfPen pen = new PdfPen(brush, 1f);
for (int i = 0;i<highlightAnnotation.QuadPoints.Length;i += 2) {
page.Canvas.DrawLine(pen, highlightAnnotation.QuadPoints[i], highlightAnnotation.QuadPoints[i + 1]);
}
}
}
}
}
doc.SaveToFile(outputFile);
问题修复:
- 修复了高亮查找的文本,效果不正确的问题。
- 修复了加载 SVG,程序抛 "Cannot find table 'loca' in the font file" 的问题。
- 修复了合并 PDF 文档不成功的问题。
- 修复了 ChromeHtmlConverter 方式转 html 到 PDF,不能使用 PageSettings.PaperFormat 设置页面大小的问题。
- 修复了 PdfDocument.Conformance 获取结果不正确的问题。
- 修复了验证签名有效性,结果不正确的问题。
- 修复了修改书签样式,效果不正确的问题。
- 优化了 PDF 转图片的耗时。
- 修复了 XPS 转 pdf,程序抛 "ArgumentException" 错误的问题。
- 修复了 SVG 转 PDF,内容显示不完整的问题。
- 修复了验证签名不正确的问题。
- 修复了 PDF 转图片,内容丢失的问题。
- 修复了 PDF 转 Markdown,程序抛 "ObjectDisposedException" 错误的问题。
- 修复了打印 PDF 文档,内容不正确的问题。