From e02f57ef7a1ea3b917070b00ad0fdfb6f589a1d7 Mon Sep 17 00:00:00 2001 From: Jakob Heher Date: Thu, 24 Mar 2022 13:41:05 +0100 Subject: properly close opened pdf document, cf. #74 --- .../src/main/java/at/asit/pdfover/gui/workflow/states/OpenState.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'pdf-over-gui/src/main/java/at/asit/pdfover/gui') diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/OpenState.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/OpenState.java index f4d104d5..fdbc2580 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/OpenState.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/OpenState.java @@ -108,10 +108,8 @@ public class OpenState extends State { // scan for signature placeholders // - see if we want to scan for placeholders in the settings if (config.getEnablePlaceholderUsage()) { - try { + try (PDDocument pddocument = PDDocument.load(getStateMachine().getStatus().getDocument())) { // - scan for placeholders - PDDocument pddocument = PDDocument.load(getStateMachine().getStatus().getDocument()); - boolean useSignatureFields = config.getUseSignatureFields(); boolean useMarker = config.getUseMarker(); log.debug("Placeholder usage enabled. Signature fields: {}, QR Markers: {}", useSignatureFields, useMarker); -- cgit v1.2.3