Spire.Office for Java 10.7.0 已正式发布。在该版本中,Spire.Doc for Java 支持双行合一功能;Spire.XLS for Java 支持 MarkerDesigner 使用 Array 数据;Spire.PDF for Java支持将 PDF 转换为 Markdown;Spire.OCR for Java 支持自动旋转图片。除此之外,一些在转换和操作Word、Excel、PDF和PPT文档时出现的问题也已成功被修复。更多新功能及问题修复详情如下。
获取Spire.Office for Java 10.7.0,请点击:
Spire.Doc for Java
新功能:
- 支持双行合一功能,强化了 Word 转 PDF的效果。
问题修复:
- 修复了接受修订,内容控件内容不起作用的问题。
- 修复了 Word 转 PDF,程序抛 “NullPointerException” 的问题。
- 修复了获取 Word 文档属性不正确的问题。
- 修复了 Word 转 markdown 格式,项目符号错乱的问题。
- 修复了 Word 转 PDF,表格中竖向文本不正确的问题。
- 修复了替换书签内容程序抛 “IllegalArgumentException” 的问题。
- 修复了加载 Word 文档程序抛 “IllegalArgumentException: List level must be less 8 and greater then 0” 的问题。
- 修复了接受修订效果不正确的问题。
- 修复了使用 "pictureWatermark.setPicture(bufferedImage)" 程序抛 "java.lang.NullPointerException" 的问题。
- 修复了 MailMerge.executeWidthRegion(dataSource) 读取 XML 中的图片路径不正确的问题。
- 修复了 Word 文档比较结果不正确的问题。
- 修复了加载 Word 文档,程序抛 “java.lang.ClassCastException” 异常的问题。
- 修复了加载 Word 文档,程序长时间挂起的问题。
- 修复了 Word 转 PDF, 页码不正确的问题。
- 修复了 Word 转 PDF ,结果文档较大的问题。
- 修复了 Word 转 PDF,部分内容丢失的问题。
- 修复了加载 .odt 文档,程序抛 “Culture Name: - is not a supported culture” 的问题。
Spire.XLS for Java
新功能:
- MarkerDesigner支持使用 Array 数据。
Workbook workbook = new Workbook();
// Get the first worksheet from the workbook
Worksheet sheet = workbook.getWorksheets().get(0);
// Set the value of cell range A1 to "&=Array"
sheet.getCellRange("A1").setValue("&=Array");
// Add a parameter named "Array" with an array of strings as its value
workbook.getMarkerDesigner().addArray("Array", new String[] { "Spire.Xls", "Spire.Doc", "Spire.PDF", "Spire.Presentation", "Spire.Email" });
// Apply the marker design to the workbook
workbook.getMarkerDesigner().apply();
// Calculate all the values in the workbook
workbook.calculateAllValue();
// Auto-fit the rows and columns in the allocated range of the worksheet
sheet.getAllocatedRange().autoFitRows();
sheet.getAllocatedRange().autoFitColumns();
// Save the workbook to the specified file path using Excel 2013 format
workbook.saveToFile(outputFile, ExcelVersion.Version2013);
// Clean up and release resources used by the workbook
workbook.dispose();
问题修复:
- 修复了 Excel 转 PDF,linux 环境下字体不正确的问题。
- 修复了 Excel 转 HTML,设置 “isWriteUnMergedColSpan(false)" 效果不正确的问题。
- 修复了加载 Excel 文档,程序抛 “ Invalid formula:"=#ref!".” 的问题。
- 修复了 Excel 转 PDF,布局效果不正确的问题。
- 修复了CSV转EXCEL时,程序抛“For input string: "OP_ID"”错误的问题。
- 修复了加载 Excel 文档,程序抛 "java.lang.NullPointerException" 的问题。
- 修复了Excel转Html时,设置setIsFixedTableColWidth,单元格样式不一致的问题。
- 内部对 "sun.misc.BASE64Decoder" 的引用进行调整。
Spire.PDF for Java
新功能:
- 支持将PDF转换为markdown格式。
PdfDocument doc = new PdfDocument("input.pdf");
doc.saveToFile("output.md", FileFormat.Markdown);
调整:
- 内部对"sun.misc.BASE64Decoder"的引用进行调整。
问题修复:
- 修复了PDF转图片时,文本乱码的问题。
- 修复了PDF转图片时,程序抛"NegativeArraySizeException"的问题。
- 修复了PDF转HTML时,linux系统生成的css目录名称不正确的问题。
- 修复了替换文本,字体不正确的问题。
- 修复了OFD转PDF,内容被旋转的问题。
- 修复了使用pdfGrayConverter.toGrayPdf,程序抛"NegativeArraySizeException"的问题。
- 修复了OFD转PDF,内容被旋转的问题。
- 修复了合并PDF的书签跳转位置不正确的问题
- 修复了LicenseProvider.setLicense(path)设置路径中含“\”报错的问题。
- 修复了查找文本失败的问题。
- 修复了系统DPI设置为150%时,打印的PDF内容被缩小的问题。
- 修复了SVG 转PDF效果不正确的问题。
Spire.Presentation for Java
问题修复:
- 修复了拆分PPT文档时,程序抛“java.lang.OutOfMemoryError: Java heap space”的问题。
Spire.OCR for Java
新功能:
- 支持Linux-ARM平台。
- 支持自动旋转图片。
- 支持按照图片排版输出文本。
ConfigureOptions configureOptions = new ConfigureOptions();
configureOptions.SetAutoRotate(true);
VisualTextAligner visualTextAligner = new VisualTextAligner(scanner.getText());
String scannedText = visualTextAligner.toString();
问题修复:
- 修复了针对"temp" 临时空文件夹的清理。
- 修复了路径中含有中文时报”Error occurred during ConfigureDependencies“错误的问题。
- 修复了的内容提取顺序不正确的问题。