From 05452392941195e2f419793b45253551509048b1 Mon Sep 17 00:00:00 2001 From: Alexander Marsalek Date: Thu, 22 Jul 2021 16:39:01 +0200 Subject: more test files --- .../SignatureFieldsAndPlaceHolderExtractorTest.java | 13 +++++++++++++ pdf-as-pdfbox-2/src/test/resources/manySignFields.pdf | Bin 0 -> 181760 bytes .../src/test/resources/manySignFields_signed4.pdf | Bin 0 -> 233204 bytes 3 files changed, 13 insertions(+) create mode 100644 pdf-as-pdfbox-2/src/test/resources/manySignFields.pdf create mode 100644 pdf-as-pdfbox-2/src/test/resources/manySignFields_signed4.pdf (limited to 'pdf-as-pdfbox-2') diff --git a/pdf-as-pdfbox-2/src/test/java/at/gv/egiz/pdfas/lib/testpdfbox/SignatureFieldsAndPlaceHolderExtractorTest.java b/pdf-as-pdfbox-2/src/test/java/at/gv/egiz/pdfas/lib/testpdfbox/SignatureFieldsAndPlaceHolderExtractorTest.java index 14fb962f..e137c16e 100644 --- a/pdf-as-pdfbox-2/src/test/java/at/gv/egiz/pdfas/lib/testpdfbox/SignatureFieldsAndPlaceHolderExtractorTest.java +++ b/pdf-as-pdfbox-2/src/test/java/at/gv/egiz/pdfas/lib/testpdfbox/SignatureFieldsAndPlaceHolderExtractorTest.java @@ -5,12 +5,15 @@ import at.gv.egiz.pdfas.lib.impl.placeholder.SignaturePlaceholderData; import org.apache.pdfbox.pdmodel.PDDocument; import java.io.File; +import java.util.List; public class SignatureFieldsAndPlaceHolderExtractorTest { public static void main(String[] args) { String dir = "/Users/amarsalek/Documents/pdf-as-4/pdf-as-pdfbox-2/src/test/resources/"; + getPlacHolders(dir+ "manySignFields.pdf"); + getPlacHolders(dir+ "manySignFields_signed4.pdf"); getNextSignaturePlaceHolder(dir + "new_qr_2-2.pdf"); getNextSignaturePlaceHolder(dir + "new_qr_2_signed.pdf"); getNextSignaturePlaceHolder(dir + "new_qr_2_signed_signed.pdf"); @@ -18,6 +21,16 @@ public class SignatureFieldsAndPlaceHolderExtractorTest { //TODO convert into junit test } + private static void getPlacHolders(String filePath) { + try { + PDDocument doc = PDDocument.load(new File(filePath)); + List result = SignatureFieldsAndPlaceHolderExtractor.findEmptySignatureFields(doc); + System.out.println(filePath + ": " + result); + } catch (Throwable e) { + e.printStackTrace(); + } + } + public static void getNextSignaturePlaceHolder(String filePath) { try { PDDocument doc = PDDocument.load(new File(filePath)); diff --git a/pdf-as-pdfbox-2/src/test/resources/manySignFields.pdf b/pdf-as-pdfbox-2/src/test/resources/manySignFields.pdf new file mode 100644 index 00000000..970cd132 Binary files /dev/null and b/pdf-as-pdfbox-2/src/test/resources/manySignFields.pdf differ diff --git a/pdf-as-pdfbox-2/src/test/resources/manySignFields_signed4.pdf b/pdf-as-pdfbox-2/src/test/resources/manySignFields_signed4.pdf new file mode 100644 index 00000000..fb639c99 Binary files /dev/null and b/pdf-as-pdfbox-2/src/test/resources/manySignFields_signed4.pdf differ -- cgit v1.2.3