Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -308,13 +308,7 @@ public String getAlt() {

@Override
public Boolean getisOutsideCropBox() {
double[] cropBox = page.getCropBox();
double[] rectangle = ((PDAnnotation)simplePDObject).getRect();
if (rectangle != null && rectangle.length >= 4) {
return cropBox[1] >= rectangle[3] || cropBox[0] >= rectangle[2]
|| cropBox[3] <= rectangle[1] || cropBox[2] <= rectangle[0];
}
return null;
return PDAnnotation.isOutsideCropBox(page, (PDAnnotation)simplePDObject);
}

private static Double getDifference(double[] array, int shift) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
package org.verapdf.gf.model.impl.pd.actions;

import org.verapdf.as.ASAtom;
import org.verapdf.cos.COSArray;
import org.verapdf.cos.COSObjType;
import org.verapdf.cos.COSObject;
import org.verapdf.gf.model.impl.pd.GFPDObject;
import org.verapdf.model.pdlayer.PDMediaClip;
Expand Down Expand Up @@ -51,20 +49,6 @@ public String getAlt() {

@Override
public Boolean gethasCorrectAlt() {
COSObject object = simplePDObject.getKey(ASAtom.ALT);
if (object == null || object.getType() != COSObjType.COS_ARRAY) {
return false;
}
COSArray array = (COSArray)object.getDirectBase();
if (array.size() % 2 != 0) {
return false;
}
for (int i = 0; i < array.size(); i++) {
COSObject elem = array.at(i);
if (elem.getType() != COSObjType.COS_STRING || (i % 2 == 1 && elem.getString().isEmpty())) {
return false;
}
}
return true;
return ((org.verapdf.pd.actions.PDMediaClip)simplePDObject).hasCorrectAlt();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,7 @@ public static GFSAAnnotation createAnnot(PDAnnotation annot, PDPage page) {

@Override
public Boolean getisOutsideCropBox() {
double[] cropBox = page.getCropBox();
double[] rectangle = annot.getRect();
if (rectangle != null && rectangle.length >= 4) {
return cropBox[1] >= rectangle[3] || cropBox[0] >= rectangle[2]
|| cropBox[3] <= rectangle[1] || cropBox[2] <= rectangle[0];
}
return null;
return PDAnnotation.isOutsideCropBox(page, annot);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@
import org.verapdf.cos.COSObjType;
import org.verapdf.cos.COSObject;
import org.verapdf.pd.PDAnnotation;
import org.verapdf.pd.PDNameTreeNode;
import org.verapdf.pd.PDNamesDictionary;
import org.verapdf.pd.PDPage;
import org.verapdf.pd.actions.PDAction;
import org.verapdf.tools.StaticResources;
Expand Down Expand Up @@ -104,34 +102,6 @@ private static COSObject getDestination(PDAnnotation annot, ASAtom key) {
if (destination == null || destination.empty()) {
return null;
}
if (destination.getType() == COSObjType.COS_STRING) {
PDNamesDictionary namesDictionary = StaticResources.getDocument().getCatalog().getNamesDictionary();
if (namesDictionary == null) {
return null;
}
PDNameTreeNode dests = namesDictionary.getDests();
if (dests != null) {
destination = dests.getObject(destination.getString());
if (destination == null) {
return null;
}
}
} else if (destination.getType() == COSObjType.COS_NAME) {
COSObject dests = StaticResources.getDocument().getCatalog().getDests();
if (dests != null) {
destination = dests.getKey(destination.getName());
if (destination == null) {
return null;
}
}
}
if (destination.getType() == COSObjType.COS_DICT) {
destination = destination.getKey(key);
}
COSObject obj = null;
if (destination.getType() == COSObjType.COS_ARRAY && destination.size() > 0) {
obj = destination.at(0);
}
return obj;
return PDAnnotation.getPageFromDestination(destination, key);
}
}
Loading