Spire.Office 7.1.2已发布。本次更新带来了一些新的功能,例如:Spire.PDF支持.NET6.0以及将OFD转换为PDF和图像;Spire.Presentation支持添加设置以转换高质量图像,支持获取幻灯片背景的类型和颜色,并且包含.NET6.0;Spire.PDFViewer支持通过Pdf Viewer查看PDF时支持旋转页面。此外,该版本还修复了大量已知的问题。详情请阅读以下内容。
该版本涵盖了最新版的 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 v10.1.3
- Spire.Pdf.dll v8.1.4
- Spire.XLS.dll v11.12.2
- Spire.Email.dll v5.1.0
- Spire.DocViewer.Forms.dll v6.12.0
- Spire.PdfViewer.Forms.dll v7.1.4
- Spire.PdfViewer.Asp.dll v7.1.4
- Spire.Presentation.dll v7.1.4
- Spire.Spreadsheet v6.1.2
- Spire.OfficeViewer.Forms.dll v7.1.2
- Spire.Barcode.dll v6.1.1
- 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
新功能:
- 新增.NET 6.0
- 新增了解密PDF方法
pdf.Security.DecryptOwnerPassWord(string ownerPassword);
pdf.Security.DecryptUserPassWord();
PdfDocument doc = new PdfDocument();
doc.LoadFromFile(input);
int pageIndex = GetAttachmentPage(doc.Pages, attachmentName);
private int GetAttachmentPage(Spire.Pdf.Widget.PdfPageCollection pageCollection, string fileName)
{
if (string.IsNullOrEmpty(fileName))
{
throw new ArgumentException("fileName is null or empty");
}
for (int i = 0; i < pageCollection.Count; i++)
{
PdfPageBase page = pageCollection[i];
for (int j = 0; j < page.AnnotationsWidget.Count; j++)
{
Spire.Pdf.Annotations.PdfFileLinkAnnotationWidget pdfFileLinkAnnotationWidget = page.AnnotationsWidget[j] as Spire.Pdf.Annotations.PdfFileLinkAnnotationWidget;
if (pdfFileLinkAnnotationWidget != null)
{
if (fileName.Equals(pdfFileLinkAnnotationWidget.FileName))
{
return i;
}
}
}
}
return -1;
}
PdfDocument doc = new PdfDocument(@"input.pdf");
doc.RemoveDocumentJavaScript();
doc.SaveToFile(@"output.pdf", FileFormat.PDF);
OfdConverter converter = new OfdConverter("inputFile");
converter.ToPdf("outputFile");
converter.ToImage(pageIndex);
converter.ToImage(pageIndex, dpiX, dpiY);
converter.ToLinearizedPdf("Linearized.pdf");
PdfDocument pdfDoc = new PdfDocument();
pdfDoc.LoadFromFile(inputFile);
Spire.Pdf.PdfPageBase page;
pdfDoc.FileInfo.IncrementalUpdate = false;
string MvAddedlaverName1 = "GorLaverPagel";
for (int iPage = 0; (iPage <= (pdfDoc.Pages.Count - 1)); iPage++)
{
page = pdfDoc.Pages[iPage];
Spire.Pdf.Graphics.Layer.PdfLayer wtLaver_1 = pdfDoc.Layers.AddLayer(MvAddedlaverName1);
wtLaver_1.ViewState = LayerViewState.Allways;
wtLaver_1.PrintState = LayerPrintState.Nerver;
wtLaver_1.ExportState = LayerExportState.ExportWhenVisible;
Spire.Pdf.Graphics.PdfCanvas gPdfCanvas_1 = wtLaver_1.CreateGraphics(page.Canvas);
gPdfCanvas_1.SetTransparency(0.4f);
gPdfCanvas_1.DrawString(tStatusString, new PdfFont(PdfFontFamily.Helvetica, 28), new PdfSolidBrush(Color.Black), new System.Drawing.PointF(((page.Size.Width - 265) - (524 / 2)), (page.Size.Height - (50 - 127))));
wtLaver_1.CreateGraphics(gPdfCanvas_1);
gPdfCanvas_1.SetTransparency(1);
}
pdfDoc.SaveToFile(outputFile, FileFormat.PDF);
pdfDoc.Close();
System.Collections.Generic.List<int[]> inkList = new System.Collections.Generic.List<int[]>();
int[] intPoints = new int[]
{
100,800,
200,800,
200,700
};
inkList.Add(intPoints);
PdfInkAnnotation ia = new PdfInkAnnotation(inkList);
ia.Color = Color.LightBlue;
ia.Border.Width = 12;
ia.Opacity = 0.3f;
ia.Text = "e-iceblue";
pdfPage.AnnotationsWidget.Add(ia);
问题修复:
- 修复了加载含加密口令PDF文档失败的问题
- 修复了转换出的图片内容不正确的问题
- 修复了转换出的XPS内容不正确的问题
- 修复了在.NETCore平台上将透明的TIFF绘制到PDF时结果文档中TIFF有白色背景问题
- 修复了转换XPS到PDF内容不一致的问题
- 修复了删除PDF文件中的图片结果文档变大的问题
- 修复了转换PDF到OFD结果文档右边出现空白部分的问题
- 修复了包含“-”的单词的PDF文档转换到SVG内容不正确的问题
- 修复了转换PDF到图片程序抛System.NullReferenceException异常的问题
- 修复了打印PDF程序抛System.NullReferenceException异常的问题
- 修复了设置文本高亮显示失败的问题
- 修复了提取的文本内容不正确的问题。
- 修复了在 PDF 的每一页添加相同签名时签名无效的问题。
- 修复了添加 PdfPolygonAnnotation 后,结果不正确的问题。
- 修复了程序在提取文本时抛出“IndexOutOfRangeException”的问题。
- 修复了打印后内容不正确的问题。
- 修复了设置Pdf PolyLine Annotation边框粗细后效果不正确的问题。
- 修复了TextBox字段填充数据时,加粗字体不生效的问题。
- 修复了打印后内容不正确的问题。
- 修复了提取的附件文件名不正确的问题。
- 修复了程序在合并文档并将生成的文档保存到输入文件路径时抛出“System.IO.IOException”的问题。
- 修复了程序在将 PDF 转换为 PDF/A 时,抛出“System.NullReferenceException”的问题。
- 修復了將 .emf 文件添加到 PDF 失敗的問題。
- 修复了 XfaChoiceListField 的项目无法获取的问题。
- 修复了提取文本不正确的问题。
- 修复了替换文本后内容丢失的问题。
- 修复了查找的文本位置不正确的问题。
- 修复了数字签名的自定义时间不正确的问题。
- 修复了将注释复制到其他页面后,部分内容丢失的问题。
- 修复了添加的 PdfRubberStampAnnotation 未在结果 PDF 中显示的问题。
- 修复了设置表格 RowSpan 后,程序抛出“System.ArgumentOutOfRangeException”的问题。
Spire.Presentation
新功能:
- 支持获取幻灯片背景的类型和颜色
ISlide sld = ppt.Slides[0] as ISlide;
FillFormat bg = sld.DisplaySlideBackground.GetBackgroundFillFormat(sld as ActiveSlide);
switch (bg.FillType)
{
case FillFormatType.Solid:
sb.AppendLine("type:" + bg.FillType + "\tcolor:" + bg.SolidColor.Color);
break;
case FillFormatType.Gradient:
sb.AppendLine("type:" + bg.FillType);
foreach (GradientStop stop in bg.Gradient.GradientStops)
{
sb.AppendLine("position:" + stop.Position + "\tcolor:" + stop.Color.Color);
}
break;
default:
sb.AppendLine("type:" + bg.FillType);
break;
}
Presentation.HighQualityImage = true;
问题修复:
- 优化了操作PPT文件图片时的内存消耗。
- 修复了应用在获取音频数据时抛出“System.NullReferenceException”的问题。
- 修复了获取的网格线颜色不正确的问题。
- 修复了获取的切换时长不正确的问题。
- 修复了获取的表格单元格显示颜色不正确的问题。
- 修复了将幻灯片另存为图像后数学方程颜色丢失的问题。
- 修复了SmartArt 保存到图片后内容不正确的问题。
- 修复了程序在将形状保存到图像时抛出“System.IndexOutOfRangeException”的问题。
- 修复了“HasBullet”返回值错误的问题。
- 修复PPT转PDF后数学公式丢失的问题。
- 修复了程序在加密包含数学方程的 PPT 文件时抛出“System.NullReferenceException”的问题。
- 修复了获取的表格单元格文本显示颜色不正确的问题。
- 修复了“VerticalTextType”获取的值不正确的问题。
- 修复了 PPT 转图片后部分内容不清晰的问题。
- 修复了无法获取批注的问题。
- 修复了PPT 转 PDF 时数据标签引导线不正确的问题。
- 修复了获取动画的PresetClassType值不正确的问题。
- 修复了PPT 保存为 PDF 后图表趋势线颜色丢失的问题。
Spire.Doc
问题修复:
- 修复了提取的文本内容不正确的问题。
- 修复了在 PDF 的每一页添加相同签名时签名无效的问题。
- 修复了添加 PdfPolygonAnnotation 后,结果不正确的问题。
- 修复了程序在提取文本时抛出“IndexOutOfRangeException”的问题。
- 修复了打印后内容不正确的问题。
- 修复了设置Pdf PolyLine Annotation边框粗细后效果不正确的问题。
- 修复了TextBox字段填充数据时,加粗字体不生效的问题。
- 修复了打印后内容不正确的问题。
- 修复了提取的附件文件名不正确的问题。
- 修复了程序在合并文档并将生成的文档保存到输入文件路径时抛出“System.IO.IOException”的问题。
- 修复了程序在将 PDF 转换为 PDF/A 时,抛出“System.NullReferenceException”的问题。
- 修复了邮件合并后数字格式不正确的问题
- 修复了在多线程下更新域程序抛出错误"System.ArgumentOutOfRangeException"的问题
- 修复了加载Word文档程序抛出“Unable to cast object of type 'spr┗' to type 'spr▙”的问题
- 修复了加载Word文档程序抛出“An item with the same key has already been added”的问题
- 修复了加载Word文档程序抛出“Byte array for GUID must be exactly 16 bytes long”的问题
- 修复了加载Word文档程序抛出“Unable to read beyond the end of the stream”的问题
- 修复了加载Word文档程序抛出“Non-negative number required. Parameter name: value”的问题
- 修复了加载Word文档程序抛出“Input string was not in a correct format”的问题
- 修复了加载Word文档程序抛出“Unknown color type encountered during WordML import - #0”的问题
- 修复了加载Word文档程序抛出“Object reference not set to an instance of an object”的问题
Spire.PDFViewer
新功能:
- 支持通过Pdf Viewer查看PDF时支持旋转页面
问题修复:
- 修复了PDF内容显示不正确的问题。
- 修复了显示的PDF内容是空白的问题。
- 修复了显示的PDF文本内容乱码的问题。
- 修复了缩放模式设置“fitpage”后,滚动条仍然存在的问题。
- 修复了更改缩放模式后,程序抛出“ArgumentOutOfRangeException”的问题。
- 修复了在WPF项目中使用时,PDF内容显示不正确的问题。
- 修复了PDF图片被覆盖的问题。
- 修复了部分PDF内容无法显示的问题。