Spire.Office 8.2.2 已发布。在该版本中,Spire.PDF支持设置文本框注释的文本对齐类型,还新增 TextCompressionOptions 以支持设置压缩类型;Spire.XLS 支持 FLOOR.MATH 公式和“模拟分析”的单变量求解功能;Spire.Presentation 增强了 PPT 到图片的转换。此外,本次更新还成功修复了许多已知问题。详情请阅读以下内容。
该版本涵盖了最新版的 Spire.Doc,Spire.PDF,Spire.XLS,Spire.Email,Spire.DocViewer, Spire.PDFViewer,Spire.Presentation,Spire.Spreadsheet, Spire.OfficeViewer, Spire.DocViewer, Spire.Barcode, Spire.DataExport。
版本信息如下:
- Spire.Doc.dll v11.2.3
- Spire.Pdf.dll v9.2.6
- Spire.XLS.dll v13.2.4
- Spire.Presentation.dll v8.2.0
- Spire.Email.dll v6.2.3
- Spire.DocViewer.Forms.dll v7.10.0
- Spire.PdfViewer.Forms.dll v7.10.0
- Spire.PdfViewer.Asp.dll v7.10.0
- Spire.Spreadsheet.dll v7.1.0
- Spire.OfficeViewer.Forms.dll v8.2.2
- Spire.Barcode.dll v7.2.1
- Spire.DataExport.dll v4.8.0
- Spire.DataExport.ResourceMgr.dll v2.1.0
https://www.e-iceblue.cn/Downloads/Spire-Office-NET.html
Spire.PDF
新功能:
- 支持设置专色的颜色空间为RGB。
- 新增TextCompressionOptions以支持设置压缩类型。
- 支持设置文本框注释的文本对齐类型。
- 支持压缩PDF文件后保存到流。
PdfDocument pdf = new PdfDocument();
PdfPageBase page = pdf.Pages.Add();
PdfRGBColor c = Color.Purple;
//color space RGB
PdfSeparationColorSpace cs = new PdfSeparationColorSpace("MySpotColor", new PdfRGBColor(c.R, c.G, c.B));
//color space CMYK
PdfSeparationColorSpace cs = new PdfSeparationColorSpace("MySpotColor", new PdfRGBColor(c.C, c.M, c.Y, c.K));
//color space Grayscale
PdfSeparationColorSpace cs = new PdfSeparationColorSpace("MySpotColor", new PdfRGBColor(c.Gray));
PdfSeparationColor color = new PdfSeparationColor(cs, 1f);
PdfSolidBrush brush = new PdfSolidBrush(color);
page.Canvas.DrawPie(brush, 10, 30, 60, 60, 360, 360);
page.Canvas.DrawString("Tint=1.0", new PdfFont(PdfFontFamily.Helvetica, 10f), brush, new PointF(22, 100));
color = new PdfSeparationColor(cs, 0.5f);
brush = new PdfSolidBrush(color);
page.Canvas.DrawPie(brush, 80, 30, 60, 60, 360, 360);
page.Canvas.DrawString("Tint=0.5", new PdfFont(PdfFontFamily.Helvetica, 10f), brush, new PointF(92, 100));
color = new PdfSeparationColor(cs, 0.25f);
brush = new PdfSolidBrush(color);
page.Canvas.DrawPie(brush, 150, 30, 60, 60, 360, 360);
page.Canvas.DrawString("Tint=0.25", new PdfFont(PdfFontFamily.Helvetica, 10f), brush, new PointF(162, 100));
pdf.SaveToFile("SpotColorrgb.pdf");
PdfCompressor compressor = new PdfCompressor(fileName);
compressor.Options.TextCompressionOptions.UnembedFonts = true;
compressor.CompressToFIle(outputName);
RectangleF rect = new RectangleF(x, y, 100, 15);
PdfFreeTextAnnotation textAnnotation = new PdfFreeTextAnnotation(rect);
TextAlignment(textAnnotation);
textAnnotation.TextAlignment = PdfAnnotationTextAlignment.Right;
using (FileStream fileStream = new FileStream(outputFile, FileMode.Create))
{
PdfCompressor compressor = new PdfCompressor(inputFile);
compressor.CompressToStream(fileStream);
fileStream.Flush();
fileStream.Close();
}
问题修复:
- 优化了转换PDF到Excel消耗的时间。
- 修复了添加的文本注释在WPS软件不显示的问题。
- 修复了内容相同的两个页面转换到图片耗时相差大的问题。
- 修复了转换XPS到PDF,不可见的线条变可见的问题。
- 修复了提取PDF文档的文本,格式不正确的问题。
- 修复了获取书签的位置不正确的问题。
- 修复了转换PDF到图片,程序抛“参数无效”的问题。
- 修复了添加了具有背景色的文本框注释,在浏览器中显示不成功的问题。
- 修复了打印PDF文件后内容不正确的问题。
- 修复了在打印PDF文件后,内容向右下方偏移的问题。
- 修复了在使用PDF-XChange打开输出PDF时,复选框选中的值不显示的问题。
- 修复了扁平化PDF表单后,RadioButton字段值丢失的问题。
- 修复了扁平化PDF表单后,RadioButton字段值不正确的问题。
Spire.XLS
新功能:
- 支持设置addQuotationForStringValue的布尔值,使excel转换为CSV后的结果字符串带有引号。
- 支持运行“模拟分析”的单变量求解功能。
- 支持FLOOR.MATH公式。
Workbook workbook = new Workbook();
workbook.LoadFromFile(@"ToCSV.xlsx");
Worksheet sheet = workbook.Worksheets[0];
//The last parameter " true" makes the result strings have quotation marks
sheet.SaveToFile(@"ToCSV.csv", ",",true);
Workbook book = new Workbook();
book.LoadFromFile(inputFile);
Worksheet sheet = book.Worksheets[0];
CellRange targetCell = sheet.Range["E2"];
CellRange gussCell = sheet.Range["B4"];
GoalSeek goalSeek = new GoalSeek();
GoalSeekResult result= goalSeek.TryCalculate (targetCell, 2000, gussCell);
result.Determine();
Workbook workbook = new Workbook();
workbook.Worksheets[0].Range["A1"].Formula = "FLOOR.MATH(12.758,2,-1)";
workbook.CalculateAllValue();
workbook.SaveToFile("result.xlsx");
问题修复:
- 修复了将Excel文件转换为PDF后字体更改的问题。
- 修复了引用外部数据源后值不正确的问题。
- 修复了将Excel文件转换为PDF后内容格式不正确的问题。
- 修复了使用netstandard 将Excel文件转换为图像后内容格式不正确的问题。
- 修复了调用 DeleteRange() 方法后,条件格式范围不正确的问题。
- 修复了在为图表数据标签设置IsTextWrapped后未生效的问题。
- 修复了应用程序在将Excel文件转换为PDF时引发“OutOfMemoryError”的问题。
- 修复了获取的单元格范围背景颜色不正确的问题。
- 修复了在调用workbook.IsSaved时不生效的问题。
Spire.Presentation
问题修复:
- 修复了转换 PPT 到图片程序结束后内存不能被释放的问题。
Spire.Barcode
问题修复:
- 修复了在ASP web应用中设置UseHttpHandlerMode=“True”时,QR码位置不正确的问题。