1、错误代码 InputStream is = new BufferedInputStream(new ClassPathResource("fonts/SourceHanSans-Normal.ttc").getInputStream()); 文件位置 2、正确代码 ClassPathResource classPathResource = new ClassPathResource("fonts/SourceHanSans-Normal.ttc"); InputStream is = classPathResource.getInputStream();