diff options
Diffstat (limited to 'pdf-as-pdfbox-2/src')
-rw-r--r-- | pdf-as-pdfbox-2/src/test/java/at/gv/egiz/pdfas/lib/testpdfbox/SignatureFieldsAndPlaceHolderExtractorTest.java | 13 | ||||
-rw-r--r-- | pdf-as-pdfbox-2/src/test/resources/manySignFields.pdf | bin | 0 -> 181760 bytes | |||
-rw-r--r-- | pdf-as-pdfbox-2/src/test/resources/manySignFields_signed4.pdf | bin | 0 -> 233204 bytes |
3 files changed, 13 insertions, 0 deletions
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<String> 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 Binary files differnew file mode 100644 index 00000000..970cd132 --- /dev/null +++ b/pdf-as-pdfbox-2/src/test/resources/manySignFields.pdf diff --git a/pdf-as-pdfbox-2/src/test/resources/manySignFields_signed4.pdf b/pdf-as-pdfbox-2/src/test/resources/manySignFields_signed4.pdf Binary files differnew file mode 100644 index 00000000..fb639c99 --- /dev/null +++ b/pdf-as-pdfbox-2/src/test/resources/manySignFields_signed4.pdf |