Skip to content

Commit b1aa399

Browse files
Add new constants to ASAtom (#696)
1 parent e4445a7 commit b1aa399

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

src/main/java/org/verapdf/as/ASAtom.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,7 @@ public class ASAtom implements Comparable<ASAtom> {
264264
public static final ASAtom FDF = new ASAtom("FDF");
265265
public static final ASAtom FF = new ASAtom("Ff");
266266
public static final ASAtom FIELDS = new ASAtom("Fields");
267+
public static final ASAtom FIGURE = new ASAtom("Figure");
267268
public static final ASAtom FILE_ATTACHMENT = new ASAtom("FileAttachment");
268269
public static final ASAtom FILESPEC = new ASAtom("Filespec");
269270
public static final ASAtom FILTER = new ASAtom("Filter");
@@ -288,6 +289,7 @@ public class ASAtom implements Comparable<ASAtom> {
288289
public static final ASAtom FONT_WEIGHT = new ASAtom("FontWeight");
289290
public static final ASAtom FORM = new ASAtom("Form");
290291
public static final ASAtom FORMTYPE = new ASAtom("FormType");
292+
public static final ASAtom FORMULA = new ASAtom("Formula");
291293
public static final ASAtom FREE_TEXT = new ASAtom("FreeText");
292294
public static final ASAtom FRM = new ASAtom("FRM");
293295
public static final ASAtom FS = new ASAtom("FS");

src/main/java/org/verapdf/pd/PDAnnotation.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,4 +280,14 @@ public PD3DStream get3DD() {
280280
}
281281
return null;
282282
}
283+
284+
public static Boolean isOutsideCropBox(PDPage page, PDAnnotation annotation) {
285+
double[] cropBox = page.getCropBox();
286+
double[] rectangle = annotation.getRect();
287+
if (rectangle != null && rectangle.length >= 4) {
288+
return cropBox[1] >= rectangle[3] || cropBox[0] >= rectangle[2]
289+
|| cropBox[3] <= rectangle[1] || cropBox[2] <= rectangle[0];
290+
}
291+
return null;
292+
}
283293
}

0 commit comments

Comments
 (0)