@Test public void clipWidgetNonSign() { dictionary.setItem(COSName.FT, COSName.BTN); PDAnnotationWidget widget = new PDAnnotationWidget(dictionary); SignatureClipper.clipSignatures(Arrays.asList(widget)); assertTrue(widget.getCOSObject().containsKey(COSName.V)); assertTrue(widget.getCOSObject().containsKey(COSName.SV)); assertTrue(widget.getCOSObject().containsKey(COSName.LOCK)); }
public static void clipSignatures(Collection<PDAnnotation> annotations) { if (nonNull(annotations)) { for (PDAnnotation annotation : annotations) { if (COSName.WIDGET.getName().equals(annotation.getSubtype()) && COSName.SIG.equals(annotation.getCOSObject().getCOSName(COSName.FT))) { clipSignature(annotation.getCOSObject()); } } } }
SignatureClipper { public static void clipSignatures(Collection<PDAnnotation> annotations) { if (nonNull(annotations)) { for (PDAnnotation annotation : annotations) { if (COSName.WIDGET.getName().equals(annotation.getSubtype()) && COSName.SIG.equals(annotation.getCOSObject().getCOSName(COSName.FT))) { clipSignature(annotation.getCOSObject()); } } } } }
SignatureClipper { public static void clipSignatures(Collection<PDAnnotation> annotations) { if (nonNull(annotations)) { for (PDAnnotation annotation : annotations) { if (COSName.WIDGET.getName().equals(annotation.getSubtype()) && COSName.SIG.equals(annotation.getCOSObject().getCOSName(COSName.FT))) { clipSignature(annotation.getCOSObject()); } } } } private  SignatureClipper(); }
SignatureClipper { public static void clipSignatures(Collection<PDAnnotation> annotations) { if (nonNull(annotations)) { for (PDAnnotation annotation : annotations) { if (COSName.WIDGET.getName().equals(annotation.getSubtype()) && COSName.SIG.equals(annotation.getCOSObject().getCOSName(COSName.FT))) { clipSignature(annotation.getCOSObject()); } } } } private  SignatureClipper(); static void clipSignatures(Collection<PDAnnotation> annotations); static void clipSignatures(PDDocument doc); static boolean clipSignature(PDField field); }
SignatureClipper { public static void clipSignatures(Collection<PDAnnotation> annotations) { if (nonNull(annotations)) { for (PDAnnotation annotation : annotations) { if (COSName.WIDGET.getName().equals(annotation.getSubtype()) && COSName.SIG.equals(annotation.getCOSObject().getCOSName(COSName.FT))) { clipSignature(annotation.getCOSObject()); } } } } private  SignatureClipper(); static void clipSignatures(Collection<PDAnnotation> annotations); static void clipSignatures(PDDocument doc); static boolean clipSignature(PDField field);  }