我知道了……warning在mvn test中不出现,换了println就有了。之前的输出缺少宋体……现在好了,我下午去试一下linux1,这是linux2的报错,感谢:
2 2
0 2 8.18一 一一一一一一一一 一一一:一一一一一一一一一一(苹果)
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 3.759 s - in NewsPaperWriterByAsposeTem2Test
[INFO] Running NewsPaperWriterByAsposeTest
Unsupported operation: Table column widths may need to be calculated. Rendered column widths could differ.
At Table 1, Cell 1, Row 1, Table 1, Section 1
Other warning!
Unsupported operation: Table column widths may need to be calculated. Rendered column widths could differ.
At Table 1, Section 1
Other warning!
src/test/docs/20210426辑要-loveandpeace-direct-font-linux 99
Unsupported operation: Font subset embedded for font ‘黑体’ due to exceeding the maximum allowed size of 4194304 bytes.
Other warning!
Unsupported operation: Font subset embedded for font ‘宋体’ due to exceeding the maximum allowed size of 4194304 bytes.
Other warning!
Unsupported operation: Table column widths may need to be calculated. Rendered column widths could differ.
At Table 1, Cell 1, Row 1, Table 1, Section 1
Other warning!
Unsupported operation: Table column widths may need to be calculated. Rendered column widths could differ.
At Table 1, Section 1
Other warning!
src/test/docs/20210426辑要-loveandpeace-direct-font-linux 99
Unsupported operation: Font subset embedded for font ‘黑体’ due to exceeding the maximum allowed size of 4194304 bytes.
Other warning!
Unsupported operation: Font subset embedded for font ‘宋体’ due to exceeding the maximum allowed size of 4194304 bytes.
Other warning!
src/test/docs/20210426辑要-loveandpeace-direct-linux.doc 99
src/test/docs/20210426辑要-loveandpeace-direct-linux.doc 99
Unsupported operation: Table column widths may need to be calculated. Rendered column widths could differ.
At Table 1, Cell 1, Row 1, Table 1, Section 1
Other warning!
Unsupported operation: Table column widths may need to be calculated. Rendered column widths could differ.
At Table 1, Section 1
Other warning!
src/test/docs/20210426辑要-loveandpeace-direct-with embedded fonts-linux 99
Unsupported operation: Font subset embedded for font ‘黑体’ due to exceeding the maximum allowed size of 4194304 bytes.
Other warning!
Unsupported operation: Font subset embedded for font ‘宋体’ due to exceeding the maximum allowed size of 4194304 bytes.
Other warning!
Unsupported operation: Table column widths may need to be calculated. Rendered column widths could differ.
At Table 1, Cell 1, Row 1, Table 1, Section 1
Other warning!
Unsupported operation: Table column widths may need to be calculated. Rendered column widths could differ.
At Table 1, Section 1
Other warning!
src/test/docs/20210426辑要-loveandpeace-direct-with embedded fonts-linux 99
Unsupported operation: Font subset embedded for font ‘黑体’ due to exceeding the maximum allowed size of 4194304 bytes.
Other warning!
Unsupported operation: Font subset embedded for font ‘宋体’ due to exceeding the maximum allowed size of 4194304 bytes.
Other warning!
src/test/docs/20210426辑要-loveandpeace-direct-loadOption-with embedded fonts-linux 99
src/test/docs/20210426辑要-loveandpeace-direct-loadOption-uptoc-with embedded fonts-linux 99
8.18一 一一一一一一一一 一一一:一一一一一一一一一一(苹果)
0 8.18一 一一一一一一一一 一一一:一一一一一一一一一一(苹果)
82 82
82
src/test/docs/asposeTem1Test0_1.6.5.doc
99 99
99
99 99
src/test/docs/20210426辑要-loveandpeace-linux.doc 99
请问这连中错误如何解决呢?以及这个相关报错的描述是在哪里呢?我看了warninginfocollection,但是里面并没有关于这些报错信息的描述?
Unsupported operation: Font subset embedded for font ‘宋体’ due to exceeding the maximum allowed size of 4194304 bytes.
Unsupported operation: Table column widths may need to be calculated. Rendered column widths could differ.
public static class HandleDocumentWarnings implements IWarningCallback {
public ArrayList listOfFonts = new ArrayList();
public void warning(WarningInfo info) {
if (info.getWarningType() == WarningType.FONT_SUBSTITUTION || info.getWarningType() == WarningType.FONT_EMBEDDING) {
if (!listOfFonts.contains(info.getDescription()))
listOfFonts.add(info.getDescription());
}
}
public void printMissingFontDetails() throws Exception {
DocumentBuilder builder = new DocumentBuilder();
builder.getFont().setName("SimSun");
for (int i = 0; i < listOfFonts.size(); i++)
builder.writeln(listOfFonts.get(i).toString());
builder.getDocument().save(myDir + "warnings.docx");
}
}
Document doc = new Document(myDir + "source.doc");
FontSettings fontSettings = new FontSettings();
doc.setFontSettings(fontSettings);
fontSettings.setFontsFolder(myDir + "fake fonts folder that does not exist.", true);
HandleDocumentWarnings warningsHandler = new HandleDocumentWarnings();
doc.setWarningCallback(warningsHandler);
doc.save(myDir + "awjava-21.4.pdf");
warningsHandler.printMissingFontDetails();