Commit f2f1daef by zwb

修改简历生成html文件添加字体参数

parent bd0440f6
...@@ -727,8 +727,8 @@ public class NewEditionResumeServiceImpl implements NewEditionResumeService { ...@@ -727,8 +727,8 @@ public class NewEditionResumeServiceImpl implements NewEditionResumeService {
// 更新 base_info // 更新 base_info
objectMap.put("base", jsonObject); objectMap.put("base", jsonObject);
} }
// objectMap.put("fontSize",fontSize!=null?fontSize:"14px"); objectMap.put("fontSize",fontSize);
// objectMap.put("lineHeight",lineHeight!=null?lineHeight:"1.7"); objectMap.put("lineHeight",lineHeight);
String jsonString = JSON.toJSONString(objectMap); String jsonString = JSON.toJSONString(objectMap);
if (objectMap.get("base") != null) { if (objectMap.get("base") != null) {
......
...@@ -45,8 +45,17 @@ public class FileProcessor { ...@@ -45,8 +45,17 @@ public class FileProcessor {
String line; String line;
while ((line = reader.readLine()) != null) { while ((line = reader.readLine()) != null) {
// 替换字符串 // 替换字符串
String replaceLine = line.replace(oldData, newData).replace(oldFontSize, newFontSize).replace(oldLineHeight, newLineHeight); String processedLine = line;
writer.write(replaceLine); if (!oldData.isEmpty() && !newData.isEmpty()) {
processedLine = processedLine.replace(oldData, newData);
}
if (!oldFontSize.isEmpty() && !newFontSize.isEmpty()) {
processedLine = processedLine.replace(oldFontSize, newFontSize);
}
if (!oldLineHeight.isEmpty() && !newLineHeight.isEmpty()) {
processedLine = processedLine.replace(oldLineHeight, newLineHeight);
}
writer.write(processedLine);
writer.newLine(); // 写入换行符 writer.newLine(); // 写入换行符
} }
System.out.println("文件处理完成,已生成新的HTML文件:" + targetFilePath); System.out.println("文件处理完成,已生成新的HTML文件:" + targetFilePath);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment