我们很高兴地宣布,Spire.Office for Java 11.10.0 现已正式发布。本次版本带来两项重要更新:Spire.PDF for Java 现支持在将 HTML 转换为 PDF 时设置字体,并支持将 PDF 中的指定页面范围转换为 Word; Spire.Presentation for Java 现支持将 PowerPoint 演示文稿转换为 Markdown。此外,在 Word、Excel、PDF 和 PowerPoint 文件的转换与处理过程中出现的多个问题也已得到成功修复。完整详情请参见下文。
获取 Spire.Office for Java 11.10.0,请点击:
https://www.e-iceblue.cn/Downloads/Spire-Office-JAVA.html
Spire.Doc for Java
问题修复:
- 修复了 Word 转 PDF 后内容与源文档不一致的问题。
- 修复了更新 Word 目录域后页码显示不正确的问题。
- 修复了接受修订后文档内容不正确的问题。
- 修复了 Word 转 PDF 时生成多余空白页的问题。
- 修复了插入题注后编号无法自动更新的问题。
- 修复了 Word 转 PDF 过程中内存未及时释放的问题。
- 修复了清空注释后注释仍然保留、操作未生效的问题。
- 修复了替换长文本时触发 OutOfMemoryError 异常的问题。
Spire.XLS for Java
问题修复:
- 修复了 Excel 转 PDF 过程中程序一直挂起、转换失败的问题。
Spire.Presentation for Java
新功能:
- 支持将 PPT (X) 转换为 Markdown 文件格式。
Presentation presentaion = new Presentation();
presentaion.loadFromFile(inputFile);
presentaion.saveToFile(outputFile, FileFormat.Markdown);
presentaion.dispose();
问题修复:
- 修复了将 PPT (X) 转换为 PDF 后内容布局不一致的问题。
Spire.PDF for Java
新功能:
- 支持在 HTML 转 PDF 时设置字体。
- PdfGridCellContent 新增 setTextPen(PdfPen) 方法。
- 支持指定 PDF 页面范围转换到 Word。
ConvertOptions options = new ConvertOptions();
options.setAllowedFonts(new String[] { "Times New Roman", "Arial" });
converter.convertToPdf(input, output, options);
PdfDocument doc = new PdfDocument();
PdfPageBase page = doc.getPages().add();
PdfGrid grid = new PdfGrid();
grid.getStyle().setCellSpacing(1.0f);
PdfGridRow row = grid.getRows().add();
grid.getColumns().add(2);
float width = (float) page.getCanvas().getClientSize().getWidth()-(grid.getColumns().getCount() + 1);
grid.getColumns().get(0).setWidth(width * 0.8f);
PdfGridCell pdfGridCell = row.getCells().get(0);
PdfGridCellStyle pdfGridStyle =new PdfGridCellStyle();
PdfPen pen = PdfPens.getGreen();
pdfGridStyle.setTextPen(pen);
pdfGridStyle.setTextBrush(PdfBrushes.getBlack());
Font font=new Font("方正仿宋_GBK", Font.PLAIN, 12);
PdfTrueTypeFont trueTypeFont = new PdfTrueTypeFont(font, true);
pdfGridStyle.setFont(trueTypeFont);
pdfGridCell.setStyle(pdfGridStyle);
pdfGridCell.setValue("Thank you for interest in Spire.PDF.");
PdfGridCellContentList lst = new PdfGridCellContentList();
PdfGridCellContent textAndStyle = new PdfGridCellContent();
textAndStyle.setText("Thank you for interest in Spire.PDF.");
textAndStyle.setFont(trueTypeFont);
textAndStyle.setPen(PdfPens.Green());
textAndStyle.setBrush(PdfBrushes.getGreen());
lst.getList().add(textAndStyle);
row.getCells().get(1).setValue(lst);
PdfLayoutResult result = grid.draw(page, new Point2D.Float(10, 100));
doc.saveToFile("result_Bold.pdf", FileFormat.PDF);
PdfToWordConverter pdfToWordConverter = new PdfToWordConverter(inputPath);
pdfToWordConverter.saveToDocx(0, 2, outputPath);
问题修复:
- 修复了 PDF 转 Word 时单词间空格丢失的问题。
- 修复了 PDF 转 Word 流式布局下图表数据丢失的问题。
- 修复了 PDF 转 Word 时转换效果不准确的问题。
- 修复了 PDF 转 Word 时字体名称多出前缀及加粗效果丢失的问题。
- 修复了 PDF 转 Word 时格式错乱的问题。
- 修复了调用 ImageReader.getImageMetadata 时抛出 NoSuchMethodException 异常的问题。
- 修复了 PDF 转 Word,内容布局错乱的问题。
- 修复了提取表格文本时,单元格中文本的空格丢失的问题。
- 修复了 PDF 转图片时,签章颜色发生改变的问题。







