Просмотр исходного кода

fix: use PDDocument.load() instead of deprecated Loader class

Replace deprecated PDFBox Loader.load() with PDDocument.load() for PDF parsing.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
liaoxg 2 месяцев назад
Родитель
Сommit
7b4e84d6e7

+ 1 - 2
cfc-backend/src/main/java/com/etotem/cfc/service/ReportParseService.java

@@ -3,7 +3,6 @@ package com.etotem.cfc.service;
 import com.etotem.cfc.dto.ParsedReport;
 import com.etotem.cfc.entity.DanAssessmentResult;
 import lombok.extern.slf4j.Slf4j;
-import org.apache.pdfbox.Loader;
 import org.apache.pdfbox.pdmodel.PDDocument;
 import org.apache.pdfbox.text.PDFTextStripper;
 import org.springframework.stereotype.Service;
@@ -63,7 +62,7 @@ public class ReportParseService {
         }
 
         String text;
-        try (PDDocument document = Loader.loadPDF(file)) {
+        try (PDDocument document = PDDocument.load(file)) {
             PDFTextStripper stripper = new PDFTextStripper();
             text = stripper.getText(document);
         } catch (IOException e) {