RED-4875 - close pdfdoc in finally and add UtilityClass annotation for class PdfTextExtraction
This commit is contained in:
parent
c6ed6a2775
commit
46f3b74cb5
@ -69,9 +69,10 @@ public class InvisibleElementRemovalService {
|
|||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("File could not be saved after invisible element removal");
|
log.error("File could not be saved after invisible element removal");
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
|
} finally {
|
||||||
|
pdfDoc.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
pdfDoc.close();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -11,7 +11,9 @@ import com.pdftron.pdf.Page;
|
|||||||
import com.pdftron.pdf.PageIterator;
|
import com.pdftron.pdf.PageIterator;
|
||||||
import com.pdftron.pdf.TextExtractor;
|
import com.pdftron.pdf.TextExtractor;
|
||||||
|
|
||||||
|
import lombok.experimental.UtilityClass;
|
||||||
|
|
||||||
|
@UtilityClass
|
||||||
public class PdfTextExtraction {
|
public class PdfTextExtraction {
|
||||||
|
|
||||||
private static String execute(PDFDoc pdfDoc) throws IOException, PDFNetException{
|
private static String execute(PDFDoc pdfDoc) throws IOException, PDFNetException{
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user