@xl1,
现在,当我复制您在自定义文件夹中共享的字体时,以下代码也将在我的页面上产生187页。
Document doc = new Document(myDir + "source.doc");
FontSettings fontSettings = new FontSettings();
addFontFolder(fontSettings, myDir + "CustomFonts/");
doc.setFontSettings(fontSettings);
doc.save(myDir + "awjava-21.4.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);
}
我还发现,除了上述字体外,您还需要在自定义文件夹中复制以下字体以获得所需的99页。 请同时使用以下字体:
- Times New Roman.zip (2.2 MB)
- SimSun.7z.001.7z (4 MB)
- SimSun.7z.002.7z (4 MB)
- SimSun.7z.003.7z (4 MB)
- SimSun.7z.004.7z (1.8 MB)
请从文件名末尾删除.7z,然后提取多部分压缩文件。