Commit f2f1daef by zwb

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

parent bd0440f6
......@@ -727,8 +727,8 @@ public class NewEditionResumeServiceImpl implements NewEditionResumeService {
// 更新 base_info
objectMap.put("base", jsonObject);
}
// objectMap.put("fontSize",fontSize!=null?fontSize:"14px");
// objectMap.put("lineHeight",lineHeight!=null?lineHeight:"1.7");
objectMap.put("fontSize",fontSize);
objectMap.put("lineHeight",lineHeight);
String jsonString = JSON.toJSONString(objectMap);
if (objectMap.get("base") != null) {
......
......@@ -45,8 +45,17 @@ public class FileProcessor {
String line;
while ((line = reader.readLine()) != null) {
// 替换字符串
String replaceLine = line.replace(oldData, newData).replace(oldFontSize, newFontSize).replace(oldLineHeight, newLineHeight);
writer.write(replaceLine);
String processedLine = line;
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(); // 写入换行符
}
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