Spire.Doc for Java 12.6.2 supports displaying a prompt message when a corresponding font is not found during conversion

2024-06-18 09:43:27

We're pleased to announce the release of Spire.Doc for Java 12.6.2. This version supports displaying a prompt message when a corresponding font is not found during Word conversion. Meanwhile, it also fixes some issues that occurred when converting Word to PDF, and HTML to Word. More details are listed below.

Here is a list of changes made in this release

Category ID Description
New feature SPIREDOC-10465 Supports displaying a prompt message when a corresponding font is not found during Word conversion.
Document doc = ConvertUtil.GetNewEngineDocument();
doc.loadFromFile(input);
HandleDocumentSubstitutionWarnings substitutionWarningHandler = new HandleDocumentSubstitutionWarnings();
doc.setWarningCallback(substitutionWarningHandler);
doc.saveToFile(output_1);
StringBuilder sb = new StringBuilder();
Iterator iterator = substitutionWarningHandler.FontWarnings.iterator();
while(iterator.hasNext()){
    System.out.println(((WarningInfo)iterator.next()).getDescription());
}
String s = substitutionWarningHandler.FontWarnings.get(0).getDescription();
WarningSource warningSource = substitutionWarningHandler.FontWarnings.get(0).getSource();
substitutionWarningHandler.FontWarnings.clear(); 
class HandleDocumentSubstitutionWarnings implements IWarningCallback
{
    public void warning(WarningInfo info) {
        if(info.getWarningType() == WarningType.Font_Substitution)
            FontWarnings.warning(info);
    }
    public WarningInfoCollection FontWarnings = new WarningInfoCollection();
}
Bug SPIREDOC-10413 Fixes the issue that the text shifted upwards when converting a Word document to PDF.
Bug SPIREDOC-10486 Fixes the issue that the content layout was inconsistent when converting a Word document to PDF.
Bug SPIREDOC-10504 Fixes the issue that the application threw a "'td' is expected" error when converting an HTML to Word.
Bug SPIREDOC-10589 Fixes the issue that text content was partially lost when converting a Word document to an image.
Bug SPIREDOC-10592 Fixes the issue that the application threw a "String index out of range: -1" error when converting a Word document to PDF
Click the link below to download Spire.Doc for Java 12.6.2: