From 868cc95e3f9cdaf4a8c3a6757368d3ba0877c2fa Mon Sep 17 00:00:00 2001 From: luotaiqian <1147642922@qq.com> Date: Thu, 20 Aug 2026 11:42:36 +0800 Subject: [PATCH] PaperBasicInfo --- .../org/qinan/cedu/service/impl/PaperServiceImpl.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/safety-cedu-service/src/main/java/org/qinan/cedu/service/impl/PaperServiceImpl.java b/safety-cedu-service/src/main/java/org/qinan/cedu/service/impl/PaperServiceImpl.java index 6d12c1be..346c01ba 100644 --- a/safety-cedu-service/src/main/java/org/qinan/cedu/service/impl/PaperServiceImpl.java +++ b/safety-cedu-service/src/main/java/org/qinan/cedu/service/impl/PaperServiceImpl.java @@ -389,7 +389,7 @@ public class PaperServiceImpl extends ServiceImpl implemen Document document = new Document(PageSize.A4, 50, 50, 50, 50); PdfWriter.getInstance(document, out); document.open(); - // STSong-Light 为阅读器内置中文字体(cmaps已内置于openpdf jar),无需嵌入字体文件 + // STSong-Light:openpdf内置中文字体,由阅读器渲染,无需嵌入字体文件 BaseFont baseFont = BaseFont.createFont("STSong-Light", "UniGB-UCS2-H", BaseFont.NOT_EMBEDDED); addPaperPdfHeader(document, baseFont, examInfo.getPaperBasicInfoVO()); if (!CollectionUtils.isEmpty(examInfo.getQuestionVOList())) { @@ -439,15 +439,18 @@ public class PaperServiceImpl extends ServiceImpl implemen QuestionTypeEnum typeEnum = QuestionTypeEnum.fromCode(question.getQuestionType()); String typeLabel = typeEnum == null ? question.getQuestionType() : typeEnum.getDesc() + "题"; String score = question.getScore() == null ? "0" : question.getScore().toPlainString(); - Paragraph questionLine = new Paragraph("(" + typeLabel + ")" + questionNum + "." + question.getTitle() - + "(题目分值:" + score + ")", new Font(baseFont, 10, Font.NORMAL)); + StringBuilder questionText = new StringBuilder(); + questionText.append("(").append(typeLabel).append(")") + .append(questionNum).append(". ").append(question.getTitle()) + .append("(题目分值:").append(score).append(")"); + Paragraph questionLine = new Paragraph(questionText.toString(), new Font(baseFont, 10, Font.NORMAL)); questionLine.setSpacingBefore(8f); document.add(questionLine); if (CollectionUtils.isEmpty(question.getQuestionOptionVOList())) { return; } for (QuestionOptionVO option : question.getQuestionOptionVOList()) { - Paragraph optionLine = new Paragraph(option.getOptionKey() + ":" + option.getOptionText(), + Paragraph optionLine = new Paragraph(option.getOptionKey() + ": " + option.getOptionText(), new Font(baseFont, 10, Font.NORMAL)); optionLine.setIndentationLeft(20f); document.add(optionLine);