无法从mongodb打开ttf文件

时间:2019-11-11 12:46:51

标签: java itext

无法打开位于mongo(即外部http位置)中的ttf文件

但是,如果我们从本地系统提供位置信息,就可以正常工作

例如:

File file  = new File("resources");
Font font = FontFactory.getFont(file.getCanonicalPath()+"/cambria.ttf");

font返回一个对象

但是

Font font = FontFactory.getFont("http://10.******/cambria.ttf");

font返回null,导致IOException无法打开文件

但是文件可以在该位置找到

0 个答案:

没有答案