Spire.Doc for Java 14.5.3 supports footnote/endnote counting and font embedding option

Spire.Doc for Java 14.5.3 supports footnote/endnote counting and font embedding option

2026-05-22 08:45:27

We’re pleased to announce the release of Spire.Doc for Java 14.5.3. This version adds support for retrieving the number of footnotes or endnotes, as well as the “Embed only characters used in the document” setting. It also fixes several issues related to Word-to-PDF conversion, including inconsistent formatting and blurry images. More details are listed below.

Here is a list of changes made in this release

Category ID Description
New Feature SPIREDOC-11693 Added support for retrieving the number of footnotes or endnotes.
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");
                        }
                    }
                }
            }
        }
New Feature SPIREDOC-11878 Added support for the “Embed only characters used in the document” setting.
doc.setEmbedFontsInFile(true);
doc.setSaveSubsetFonts(true);
Bug Fix SPIREDOC-11829 Fixed an issue with inconsistent formatting when converting Word to PDF.
Bug Fix SPIREDOC-11899 Fixed an issue with blurry images when converting Word to PDF.
Click the link below to download Spire.Doc for Java 14.5.3: