Spire.Office for Java 11.5.0 のリリースをお知らせします。本バージョンでは、Spire.PDF for Java に PDF 変換の進捗コールバック機能が追加されました。Spire.Doc for Java では、脚注・文末脚注のカウント機能およびフォント埋め込みオプションが追加されました。Spire.Presentation for Java では、画像圧縮機能が追加されています。また、本バージョンでは多数の不具合が修正されています。詳細は以下をご覧ください。
Spire.Office for Java 11.5.0 を入手する場合は、以下のリンクをクリックしてください:
変更内容一覧
Spire.Doc for Java
| カテゴリー | ID | 説明 |
| 新機能 | SPIREDOC-11693 | 脚注または文末脚注の数を取得する機能を追加しました。
Document doc = new Document();
doc.loadFromFile(inputFile);
StringBuilder sb = new StringBuilder();
for (int n = 0; n < doc.getSections().getCount(); n++) {
Section s = doc.getSections().get(n);
for (int i = 0; i < s.getParagraphs().getCount(); i++) {
Paragraph para = s.getParagraphs().get(i);
for (int j = 0, cnt = para.getChildObjects().getCount(); j < cnt; j++) {
ParagraphBase pBase = (ParagraphBase) para.getChildObjects().get(j);
if (pBase instanceof Footnote) {
Footnote fn = (Footnote) pBase;
if (fn.getFootnoteType() == FootnoteType.Footnote) {
StringBuilder fnText = new StringBuilder();
for (int k = 0; k < fn.getTextBody().getParagraphs().getCount(); k++) {
fnText.append(fn.getTextBody().getParagraphs().get(k).getText());
}
sb.append("Footnote:"+ fnText.toString() + "\nFootnoteID:" + fn.getId() + "\n");
}
if (fn.getFootnoteType() == FootnoteType.Endnote) {
StringBuilder enText = new StringBuilder();
for (int k = 0; k < fn.getTextBody().getParagraphs().getCount(); k++) {
enText.append(fn.getTextBody().getParagraphs().get(k).getText());
}
sb.append("Endnote:"+ enText.toString() + "\nEndnoteID:" + fn.getId() + "\n");
}
}
}
}
} |
| 新機能 | SPIREDOC-11878 | 「文書で使用されている文字のみを埋め込む」設定に対応しました。
doc.setEmbedFontsInFile(true); doc.setSaveSubsetFonts(true); |
| 不具合修正 | SPIREDOC-11829 | Word から PDF への変換時に書式が一致しない問題を修正しました。 |
| 不具合修正 | SPIREDOC-11899 | Word から PDF への変換時に画像がぼやける問題を修正しました。 |
Spire.PDF for Java
| カテゴリー | ID | 説明 |
| 新機能 | SPIREPDF-8044 | PDF ドキュメント変換時の進捗コールバック機能を追加しました。
class CustomProgressNotifier implements IProgressNotifier {
StringBuilder str = new StringBuilder();
private String outputFile;
public CustomProgressNotifier(String outputFile) {
this.outputFile = outputFile;
}
@Override
public void notify(float progress) {
str.append("==============Progress: ").append(progress).append("%==============\n");
try {
Files.writeString(Paths.get(outputFile), str.toString());
} catch (Exception e) {
e.printStackTrace();
}
}
}
//using
PdfDocument pdf=new PdfDocument();
pdf.loadFromFile("test.pdf");
pdf.registerProgressNotifier(new CustomProgressNotifier("Progress.txt"));
pdf.saveToFile("out.docx", FileFormat.DOCX);
pdf.dispose(); |
| 不具合修正 | SPIREPDF-7642 | SVG から PDF への変換時にコンテンツが一致しない問題を修正しました。 |
| 不具合修正 | SPIREPDF-7683 | デジタル署名の検証結果が正しくない問題を修正しました。 |
Spire.Presentation for Java
| カテゴリー | ID | 説明 |
| 新機能 | SPIREPPT-3082 | 画像圧縮機能を追加。
Presentation presentation = new Presentation();
presentation.loadFromFile(inputFile);
SlideCollection slides = presentation.getSlides();
for (int i = 0; i < slides.getCount(); i++) {
ISlide slide = slides.get(i);
ShapeCollection shapes = slide.getShapes();
for (int j = 0; j < shapes.getCount(); j++) {
IShape shape = shapes.get(j);
if (shape instanceof SlidePicture) {
SlidePicture slidepicture = (SlidePicture) shape;
// 数値が小さいほど、圧縮率が高くなります
boolean result = slidepicture.getPictureFill().getCompressImage( true, 50f);
}
}
} |
| 不具合修正 | SPIREPPT-3093 | PowerPoint を PDF に変換した際に背景色が不正になる不具合を修正。 |






