Example usage for org.apache.pdfbox.pdmodel.interactive.action PDFormFieldAdditionalActions getK

List of usage examples for org.apache.pdfbox.pdmodel.interactive.action PDFormFieldAdditionalActions getK

Introduction

In this page you can find the example usage for org.apache.pdfbox.pdmodel.interactive.action PDFormFieldAdditionalActions getK.

Prototype

public PDAction getK() 

Source Link

Document

This will get a JavaScript action to be performed when the user types a keystroke into a text field or combo box or modifies the selection in a scrollable list box.

Usage

From source file:org.apache.tika.parser.pdf.AbstractPDF2XHTML.java

License:Apache License

private void processAcroField(PDField field, final int currentRecursiveDepth)
        throws SAXException, IOException, TikaException {

    if (currentRecursiveDepth >= MAX_ACROFORM_RECURSIONS) {
        return;//from  ww  w.  java  2  s.  co m
    }

    PDFormFieldAdditionalActions pdFormFieldAdditionalActions = field.getActions();
    if (pdFormFieldAdditionalActions != null) {
        handleDestinationOrAction(pdFormFieldAdditionalActions.getC(), ActionTrigger.FORM_FIELD_RECALCULATE);
        handleDestinationOrAction(pdFormFieldAdditionalActions.getF(), ActionTrigger.FORM_FIELD_FORMATTED);
        handleDestinationOrAction(pdFormFieldAdditionalActions.getK(), ActionTrigger.FORM_FIELD_KEYSTROKE);
        handleDestinationOrAction(pdFormFieldAdditionalActions.getV(), ActionTrigger.FORM_FIELD_VALUE_CHANGE);
    }
    if (field.getWidgets() != null) {
        for (PDAnnotationWidget widget : field.getWidgets()) {
            handleWidget(widget);
        }
    }

    addFieldString(field);
    if (field instanceof PDNonTerminalField) {
        int r = currentRecursiveDepth + 1;
        xhtml.startElement("ol");
        for (PDField child : ((PDNonTerminalField) field).getChildren()) {
            processAcroField(child, r);
        }
        xhtml.endElement("ol");
    }
}