Spire.Office 6.6已发布。本次更新带来一些新的功能,比如:Spire.PDF 支持转换 PDF 为透明背景的图片,同时还支持PDF签名添加时间戳时设置用户名和密码;Spire.XLS支持转换 Excel 到 PDF 时指定字体目录;Spire.Doc 支持添加跨整个页面的横线等等。同时,该版本还修复了大量已知问题。详情请阅读以下内容。
该版本涵盖了最新版的Spire.Doc, Spire.PDF, Spire.XLS, Spire.Presentation, Spire.Email, Spire.DocViewer, Spire.PDFViewer, Spire.Spreadsheet, Spire.OfficeViewer, Spire.DataExport, Spire.Barcode。
版本信息如下:
- Spire.License.dll 1.3.15
- Spire.Barcode.dll 5.6.0
- Spire.Email.dll 4.6.0
- Spire.DataExport.dll 4.1.9
- Spire.Pdf.dll 7.6.0
- Spire.PdfViewer.Forms.dll 6.6.0
- Spire.PdfViewer.Asp.dll 6.6.0
- Spire.Doc.dll 9.6.10
- Spire.DocViewer.Forms.dll 6.6.0
- Spire.XLS.dll 11.6.0
- Spire.Spreadsheet.dll 5.6.0
- Spire.Presentation.dll 6.6.2
- Spire.OfficeViewer.Forms.dll 6.6.2
https://www.e-iceblue.cn/Downloads/Spire-Office-NET.html
Spire.PDF
新功能:
- 支持转换PDF为透明背景的图片
PdfDocument doc = new PdfDocument();
doc.LoadFromFile("input.pdf");
doc.ConvertOptions.SetPdfToImageOptions(0);
Image image = doc.SaveAsImage(0);
image.Save("output.png", ImageFormat.Png);
static void Main(string[] args)
{
X509Certificate2 x509 = new X509Certificate2(inputFile_pfx, password);
PdfDocument doc = new PdfDocument();
doc.LoadFromFile(inputFile);
PdfPKCS7Formatter formatter = new PdfPKCS7Formatter(x509, false);
formatter.TimestampService = new TSAHttpService("http://time.certum.pl");
PdfOrdinarySignatureMaker signatureMaker = new PdfOrdinarySignatureMaker(doc, formatter);
IPdfSignatureAppearance signatureAppearance = new PdfCustomSignatureAppearance();
signatureMaker.MakeSignature("sign", doc.Pages[0], 100, 100, 100, 100, signatureAppearance);
doc.SaveToFile(outputFile, FileFormat.PDF);
doc.Close();
}
public class PdfCustomSignatureAppearance : IPdfSignatureAppearance
{
public void Generate(PdfCanvas g)
{
float fontSize = 10;
PdfTrueTypeFont font = new PdfTrueTypeFont(new Font("Arial", fontSize), true);
g.DrawString("AAAAAAAAAAA", font, PdfBrushes.Red, new PointF(0, 0));
}
}
string url = "http://test1.tsa.cn/tsa";
signature.ConfigureTimestamp(url, "tsademo", "tsademo");
doc.LoadFromSvg(Stream stream);
问题修复:
- 修复了验证签名是否被修改时返回值不正确的问题
- 修复了加密文档后文档损坏的问题
- 修复了strong和em标签解析不正确的问题
- 修复了PDF转图片,第一页是空白的问题
- 修复了解析HTML 标签,两个标签之间的空格宽度会比较大的问题
- 修复了转换PDF到SVG内容不正确的问题
- 修复了转换SVG到PDF内容不正确的问题
- 修复了转换PDF到图片内容不正确的问题
- 修复了添加的数字签名无效的问题
- 修复了添加的数字签名签署时间不正确的问题
- 修复了转换PDF到Excel,控制台打印“-------------AGAIN”的问题
- 修复了转换XPS到PDF的内容不正确的问题
- 修复了打印了PDF结果不正确的问题
- 修复了合并PDF结果文档打开报错的问题
- 修复了.NETStandard平台获取的图片位置信息不正确的问题
- 修复了扁平化域后文本位置改变的问题
- 删除了Security.Permissions的set方法
- 修复了PDFA/3B文档添加数字签名后不符合规范的问题
- 修复了转换PDF到SVG结果文档打开报错的问题
Spire.XLS
新功能:
- 支持判断行或列是否隐藏
sheet.GetColumnIsHide(columnIndex)
sheet.GetRowIsHide(rowIndex)
workbook.CustomFontFileDirectory = new string[] { "./Data/Font" };
问题修复:
- 修复了转换Sheet到HTML多出下划线的问题
- 修复了转换Excel到HTML结果不正确的问题
- 修复了移除过滤器后内容不正确的问题
- 修复了插入行抛异常“Can't insert row”的问题
- 修复了Docker环境中转换Excel到PDF抛异常“Index was out of range"的问题
- 修复了转换ChartSheet到图片内容不正确的问题
- 修复了加载XLSX文件抛异常“System.OverflowException”的问题
- 修复了加载XLSX文件抛异常“System.ArgumentOutOfRangeException”的问题
- 修复了转换Excel到PDF,文本换行不正确的问题
- 修复了转换Excel到PDF抛异常“Input string was not in a correct format”的问题
- 修复了转换图表到图片内容不正确的问题
- 修复了转换Excel到PDF页面边距不正确的问题
- 修复了设置125%DPI时,转换Excel到图片内容不完整的问题
- 修复了获取到单元格样式不正确的问题
- 修复了转换Excel到PDF艺术字被裁剪的问题
- 修复了加载XLSX文档抛异常“Invalid cell name”的问题
- 修复了转换Excel到SVG抛异常“OutOfRangeException”的问题
- 修复了转换Excel到PDF抛异常“NullReferenceException”的问题
- 修复了导出Excel数据时抛异常“System.Data.DuplicateNameException”的问题
Spire.Doc
新功能:
- 支持添加跨整个页面的横线
Document doc = new Document();
Section section = doc.AddSection();
section.AddParagraph().AppendHorizonalLine();
doc.SaveToFile("result.docx", FileFormat.Docx);
问题修复:
- 修复了转换Word到图片内容不正确的问题
- 修复了添加含有中文的公式不正确的问题
- 修复了邮件合并后数字格式不正确的问题
- 修复了加载保存文档后多出额外字符的问题
- 修复了添加的公式不正确的问题
- 修复了转换Word到PDF内容不正确的问题
- 修复了添加的HTML文本,字母列表未正确解析的问题
- 修复了转换Word到PDF表格不正确的问题
- 修复了转换RTF到PDF,图片内容不正确的问题
- 修复了添加的数学公式对齐方式不正确的问题
- 修复了提取Word文档文本抛异常“System.ArgumentOutOfRangeException”的问题
- 修复了加载保存NPOI生成的文档,内容不正确的问题
- 修复了保存文档抛异常“System.ObjectDisposedException”的问题
- 修复了转换Word到PDF多出书签“Word Bookmarks”的问题
- 修复了转换Word到PDF,内容不正确的问题
- 修复了打印Word文档,内容不正确的问题
- 修复了转换Word到PDF图片丢失的问题
- 修复了转换Word到PDF目录不正确的问题
- 修复了转换Word到PDF文本内容丢失的问题
- 修复了转换Word到PDF分页不正确的问题
- 修复了打印Word文档纸张方向不正确的问题
- 修复了加载RTF文档抛异常“System.NullReferenceException”的问题
- 修复了加载Word文档抛异常“System.NullReferenceException”的问题
Spire.Presentation
问题修复:
- 修复了加载文档抛异常“Shape was not found”的问题
- 修复了拷贝幻灯片后,结果文档的线条格式不正确的问题
- 修复了加载文档抛异常“System.IndexOutOfRangeException”的问题
- 修复了替换文本时抛异常“Can't assign string which contains paragraph break character“的问题
- 修复了设置艺术字文本效果为拱形时不生效的问题
- 修复了转换PPT到PDF内容不正确的问题
Spire.PDFViewer
问题修复:
- 修复了PDF文档打开后乱码的问题
- 修复了PDF文档打开后内容显示不正确的问题
- 修复了PDF文档打开后显示空白的问题
- 修复了放大查看PDF时内容不显示的问题
Spire.OfficeViewer
问题修复:
- 修复了Word水印显示不完整的问题