Incorrect conversion to PDF of Word document with checkboxes

test_checkbox.zip (18.3 KB)
test_checkbox_Linux.pdf (33.5 KB)
test_checkbox_Windows.pdf (43.2 KB)

Hi team,

When converting a Word document containing checkboxes to PDF on Linux host OS (our production environment), the checkboxes are converted to question mark boxes.
Conversion to PDF of the same document on Windows 10 OS is done correctly.

Using Aspose.PDF versie 19.1 for Java.
Java version = 1.8.0_231, Java Runtime Version = 8.0.6.0 - pxa6480sr6-20191107_01(SR6), Java Compiler = j9jit29, Java VM name = IBM J9 VM

Host Operating System:
Linux, version 2.6.32-754.36.1.el6.x86_64
Windows 10 Enterprise version 20H2

Request your help in solving this.

@sojourn999

It seems like you are using Aspose.Words for the conversion. We have moved this post to the respective forum category where you will be assisted accordingly.

@sojourn999,

Please copy the latest versions of following font files from Windows 10 machine into a separate folder inside Linux machine and try running the following code of latest 21.2 version of Aspose.Words for Java:

  • Calibri
  • MS Gothic
  • Symbol
Document doc = new Document("test_checkbox.docx");

FontSettings fontSettings = new FontSettings();
addFontFolder(fontSettings, myDir + "CustomFonts/");
doc.setFontSettings(fontSettings);

doc.save("output.pdf");

private static void addFontFolder(FontSettings fontSettings, String folder)
{
    FontSourceBase[] fontSourceBases = fontSettings.getFontsSources();
    FontSourceBase[] newFontSourceBases = new FontSourceBase[fontSourceBases.length + 1];
    System.arraycopy(fontSourceBases, 0, newFontSourceBases, 0, fontSourceBases.length);
    newFontSourceBases[newFontSourceBases.length - 1] = new FolderFontSource(folder, true);
    fontSettings.setFontsSources(newFontSourceBases);
}

Do you see any missing fonts related warning messages? Please check the following articles:

Using IWarningCallback the cause of the problem on Linux became clear:
“Font ‘MS Gothic’ has not been found. Using ‘Calibri’ font instead. Reason: font info substitution.”
Thanks for the support.

@sojourn999,

It’s great that you were able to find what you were looking for. Please let us know any time you may have any further queries in future.