/** * The AA field is forbidden for the Widget annotation when the PDF is a PDF/A. This method return false and update * the errors list if this key is present. returns true otherwise * * @return false if the forbidden AA field is existing. */ protected boolean checkAAField() { if (this.pdWidget.getActions() != null) { ctx.addValidationError(new ValidationError(ERROR_ANNOT_FORBIDDEN_AA)); return false; } return true; } }
private void handleWidget(PDAnnotationWidget widget) throws TikaException, SAXException, IOException { if (widget == null) { return; } handleDestinationOrAction(widget.getAction(), ActionTrigger.ANNOTATION_WIDGET); PDAnnotationAdditionalActions annotationActions = widget.getActions(); if (annotationActions != null) { handleDestinationOrAction(annotationActions.getBl(), ActionTrigger.ANNOTATION_LOSE_INPUT_FOCUS); handleDestinationOrAction(annotationActions.getD(), ActionTrigger.ANNOTATION_MOUSE_CLICK); handleDestinationOrAction(annotationActions.getE(), ActionTrigger.ANNOTATION_CURSOR_ENTERS); handleDestinationOrAction(annotationActions.getFo(), ActionTrigger.ANNOTATION_RECEIVES_FOCUS); handleDestinationOrAction(annotationActions.getPC(), ActionTrigger.ANNOTATION_PAGE_CLOSED); handleDestinationOrAction(annotationActions.getPI(), ActionTrigger.ANNOTATION_PAGE_NO_LONGER_VISIBLE); handleDestinationOrAction(annotationActions.getPO(), ActionTrigger.ANNOTATION_PAGE_OPENED); handleDestinationOrAction(annotationActions.getPV(), ActionTrigger.ANNOTATION_PAGE_VISIBLE); handleDestinationOrAction(annotationActions.getU(), ActionTrigger.ANNOTATION_MOUSE_RELEASED); handleDestinationOrAction(annotationActions.getX(), ActionTrigger.ANNOTATION_CURSOR_EXIT); } }
/** * The AA field is forbidden for the Widget annotation when the PDF is a PDF/A. This method return false and update * the errors list if this key is present. returns true otherwise * * @return false if the forbidden AA field is existing. */ protected boolean checkAAField() { if (this.pdWidget.getActions() != null) { ctx.addValidationError(new ValidationError(ERROR_ANNOT_FORBIDDEN_AA)); return false; } return true; } }
/** * The AA field is forbidden for the Widget annotation when the PDF is a PDF/A. This method return false and update * the errors list if this key is present. returns true otherwise * * @return false if the forbidden AA field is existing. */ protected boolean checkAAField() { if (this.pdWidget.getActions() != null) { ctx.addValidationError(new ValidationError(ERROR_ANNOT_FORBIDDEN_AA)); return false; } return true; } }
void sanitizeWidgetAnnotation(PDAnnotationWidget annotationWidget) { if (annotationWidget.getAction() != null) { LOGGER.debug( "Found&Removed action on annotation widget, was {}", annotationWidget.getAction()); pdfBleachSession.recordJavascriptThreat("Annotation", "External widget"); annotationWidget.setAction(null); } sanitizeAnnotationActions(annotationWidget.getActions()); }
private void handleWidget(PDAnnotationWidget widget) throws TikaException, SAXException, IOException { if (widget == null) { return; } handleDestinationOrAction(widget.getAction(), ActionTrigger.ANNOTATION_WIDGET); PDAnnotationAdditionalActions annotationActions = widget.getActions(); if (annotationActions != null) { handleDestinationOrAction(annotationActions.getBl(), ActionTrigger.ANNOTATION_LOSE_INPUT_FOCUS); handleDestinationOrAction(annotationActions.getD(), ActionTrigger.ANNOTATION_MOUSE_CLICK); handleDestinationOrAction(annotationActions.getE(), ActionTrigger.ANNOTATION_CURSOR_ENTERS); handleDestinationOrAction(annotationActions.getFo(), ActionTrigger.ANNOTATION_RECEIVES_FOCUS); handleDestinationOrAction(annotationActions.getPC(), ActionTrigger.ANNOTATION_PAGE_CLOSED); handleDestinationOrAction(annotationActions.getPI(), ActionTrigger.ANNOTATION_PAGE_NO_LONGER_VISIBLE); handleDestinationOrAction(annotationActions.getPO(), ActionTrigger.ANNOTATION_PAGE_OPENED); handleDestinationOrAction(annotationActions.getPV(), ActionTrigger.ANNOTATION_PAGE_VISIBLE); handleDestinationOrAction(annotationActions.getU(), ActionTrigger.ANNOTATION_MOUSE_RELEASED); handleDestinationOrAction(annotationActions.getX(), ActionTrigger.ANNOTATION_CURSOR_EXIT); } }
private void handleWidget(PDAnnotationWidget widget) throws TikaException, SAXException, IOException { if (widget == null) { return; } handleDestinationOrAction(widget.getAction(), ActionTrigger.ANNOTATION_WIDGET); PDAnnotationAdditionalActions annotationActions = widget.getActions(); if (annotationActions != null) { handleDestinationOrAction(annotationActions.getBl(), ActionTrigger.ANNOTATION_LOSE_INPUT_FOCUS); handleDestinationOrAction(annotationActions.getD(), ActionTrigger.ANNOTATION_MOUSE_CLICK); handleDestinationOrAction(annotationActions.getE(), ActionTrigger.ANNOTATION_CURSOR_ENTERS); handleDestinationOrAction(annotationActions.getFo(), ActionTrigger.ANNOTATION_RECEIVES_FOCUS); handleDestinationOrAction(annotationActions.getPC(), ActionTrigger.ANNOTATION_PAGE_CLOSED); handleDestinationOrAction(annotationActions.getPI(), ActionTrigger.ANNOTATION_PAGE_NO_LONGER_VISIBLE); handleDestinationOrAction(annotationActions.getPO(), ActionTrigger.ANNOTATION_PAGE_OPENED); handleDestinationOrAction(annotationActions.getPV(), ActionTrigger.ANNOTATION_PAGE_VISIBLE); handleDestinationOrAction(annotationActions.getU(), ActionTrigger.ANNOTATION_MOUSE_RELEASED); handleDestinationOrAction(annotationActions.getX(), ActionTrigger.ANNOTATION_CURSOR_EXIT); } }
private void handleWidget(PDAnnotationWidget widget) throws TikaException, SAXException, IOException { if (widget == null) { return; } handleDestinationOrAction(widget.getAction(), ActionTrigger.ANNOTATION_WIDGET); PDAnnotationAdditionalActions annotationActions = widget.getActions(); if (annotationActions != null) { handleDestinationOrAction(annotationActions.getBl(), ActionTrigger.ANNOTATION_LOSE_INPUT_FOCUS); handleDestinationOrAction(annotationActions.getD(), ActionTrigger.ANNOTATION_MOUSE_CLICK); handleDestinationOrAction(annotationActions.getE(), ActionTrigger.ANNOTATION_CURSOR_ENTERS); handleDestinationOrAction(annotationActions.getFo(), ActionTrigger.ANNOTATION_RECEIVES_FOCUS); handleDestinationOrAction(annotationActions.getPC(), ActionTrigger.ANNOTATION_PAGE_CLOSED); handleDestinationOrAction(annotationActions.getPI(), ActionTrigger.ANNOTATION_PAGE_NO_LONGER_VISIBLE); handleDestinationOrAction(annotationActions.getPO(), ActionTrigger.ANNOTATION_PAGE_OPENED); handleDestinationOrAction(annotationActions.getPV(), ActionTrigger.ANNOTATION_PAGE_VISIBLE); handleDestinationOrAction(annotationActions.getU(), ActionTrigger.ANNOTATION_MOUSE_RELEASED); handleDestinationOrAction(annotationActions.getX(), ActionTrigger.ANNOTATION_CURSOR_EXIT); } }