|
@@ -309,7 +309,10 @@ public class FileUtils {
|
|
|
* @param excelPath Excel 文件路径
|
|
|
* @param pdfPath 输出 PDF 路径
|
|
|
*/
|
|
|
- public static void excelToPdf(String excelPath, String pdfPath) {
|
|
|
+ public static void excelToPdf(String excelPath, String pdfPath, Boolean a) {
|
|
|
+ // 显式指定中文字体
|
|
|
+ FontConfigs.setDefaultFontName("WenQuanYi Micro Hei"); // 文泉驿微米黑
|
|
|
+ FontConfigs.setFontSubstitutes("SimSun", new String[]{"WenQuanYi Micro Hei"}); // 宋体替代
|
|
|
Workbook workbook = null;
|
|
|
try {
|
|
|
// 1. 创建输出目录(如果需要)
|
|
@@ -370,7 +373,10 @@ public class FileUtils {
|
|
|
* @param exUrl
|
|
|
* @param pdfUrl
|
|
|
*/
|
|
|
- public static void excelToPdf(String exUrl, String pdfUrl, Boolean a) {
|
|
|
+ public static void excelToPdf(String exUrl, String pdfUrl) {
|
|
|
+ // 显式指定中文字体
|
|
|
+ FontConfigs.setDefaultFontName("WenQuanYi Micro Hei"); // 文泉驿微米黑
|
|
|
+ FontConfigs.setFontSubstitutes("SimSun", new String[]{"WenQuanYi Micro Hei"}); // 宋体替代
|
|
|
|
|
|
org.apache.poi.ss.usermodel.Workbook ss = null;
|
|
|
ByteArrayInputStream byteArrayInputStream = null;
|