diff options
Diffstat (limited to 'pdf-as-pdfbox-2/src/test/java')
-rw-r--r-- | pdf-as-pdfbox-2/src/test/java/at/gv/egiz/pdfas/lib/testpdfbox/SignatureFieldsAndPlaceHolderExtractorTest.java | 32 |
1 files changed, 32 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 new file mode 100644 index 00000000..14fb962f --- /dev/null +++ b/pdf-as-pdfbox-2/src/test/java/at/gv/egiz/pdfas/lib/testpdfbox/SignatureFieldsAndPlaceHolderExtractorTest.java @@ -0,0 +1,32 @@ +package at.gv.egiz.pdfas.lib.testpdfbox; + +import at.gv.egiz.pdfas.lib.impl.pdfbox2.placeholder.SignatureFieldsAndPlaceHolderExtractor; +import at.gv.egiz.pdfas.lib.impl.placeholder.SignaturePlaceholderData; +import org.apache.pdfbox.pdmodel.PDDocument; + +import java.io.File; + +public class SignatureFieldsAndPlaceHolderExtractorTest { + + public static void main(String[] args) { + String dir = "/Users/amarsalek/Documents/pdf-as-4/pdf-as-pdfbox-2/src/test/resources/"; + + getNextSignaturePlaceHolder(dir + "new_qr_2-2.pdf"); + getNextSignaturePlaceHolder(dir + "new_qr_2_signed.pdf"); + getNextSignaturePlaceHolder(dir + "new_qr_2_signed_signed.pdf"); + getNextSignaturePlaceHolder(dir + "new_qr_2_signed_signed_signed.pdf"); + //TODO convert into junit test + } + + public static void getNextSignaturePlaceHolder(String filePath) { + try { + PDDocument doc = PDDocument.load(new File(filePath)); + SignaturePlaceholderData result = + SignatureFieldsAndPlaceHolderExtractor.getNextUnusedSignaturePlaceHolder(doc); + System.out.println(filePath + ": " + result); + } catch (Throwable e) { + e.printStackTrace(); + } + } + +} |