PrizmDoc v12.0 -
Form Extractors

Form Extractors

The form extractors API allows you to detect form field elements in PDF and raster documents.

A form extractor resource represents an asynchronous form extraction process. Each form extractor that is created is assigned a unique processId.

Available URLs

URL Description
GET /PCCIS/V1/ViewingSession/u{viewingSessionId}/FormInfo Returns what kind of form field data, if any, is available in a viewing session's source document.
POST /v2/formExtractors Creates a new form extractor for a work file, starting the process of extracting form field data.
GET /v2/formExtractors/{processId} Gets the status and final output of a form extractor.

Output Schemas

GET /PCCIS/V1/ViewingSession/u{viewingSessionId}/FormInfo

Returns what kind of form field data, if any, is available in a viewing session's source document.

Request

URL Parameters

Parameter Description
{viewingSessionId} The viewingSessionId which identifies the viewing session.

Successful Response

Response Body

JSON with information about what kind of form data, if any, is available in the source document of the viewing session.

Error Responses

Status Code JSON errorCode Description
404 No viewing session with the provided {viewingSessionId} could be found.
480 "DocumentNotProvidedYet" A source document has not been provided to the viewing session.
580 "InternalError" The server encountered an internal error when handling the request.

Example

Request

GET /PCCIS/V1/ViewingSession/uDLbVh9sTmXJAmd1GeXbS9Gn3WHxs8oib2xPsW2xEFjnIDdoJcudPtxciodSYFQq6zYGabQ_rJIecdbkImTTkSA/FormInfo

Response

HTTP/1.1 200 OK
Content-Type: application/json

{
  "formType": ["acroform"]
}

POST /v2/formExtractors

Creates a new form extractor for a work file, starting the process of extracting form field data.

Request

Request Headers

Name Description
Content-Type Must be application/json
Accusoft-Affinity-Token The affinityToken of the work file specified by input.fileId. Required when server clustering is enabled.

Request Body

Successful Response

Response Body

JSON with metadata about the created form extractor process. You can check on the status of the form extraction process with additional GET requests.

Error Responses

Status Code JSON errorCode Description
400 "MissingInput" Can occur when clustering is enabled and an Accusoft-Affinity-Token request header was not provided.
480 "MissingInput" A required input value was not provided. See errorDetails in the response body.
480 "InvalidInput" An invalid input value was used. See errorDetails in the response body.
480 "FeatureNotLicensed" You are not licensed to use the form extraction feature.
580 "InternalError" The server encountered an internal error when handling the request.

Example

Request

POST /v2/formExtractors
Content-Type: application/json
Accusoft-Affinity-Token: ejN9/kXEYOuken4Pb9ic9hqJK45XIad9LQNgCgQ+BkM=

{
  "input": {
    "fileId": "ek5Zb123oYHSUEVx1bUrVQ",
    "formType": "acroform"
  }
}

Response

HTTP/1.1 200 OK
Content-Type: application/json

{
  "input": {
    "fileId": "ek5Zb123oYHSUEVx1bUrVQ",
    "formType": "acroform"
  },
  "processId": "ElkNzWtrUJp4rXI5YnLUgw",
  "state": "processing",
  "percentComplete": 0,
  "expirationDateTime": "2016-12-17T20:38:39.796Z",
  "affinityToken": "ejN9/kXEYOuken4Pb9ic9hqJK45XIad9LQNgCgQ+BkM="
}

GET /v2/formExtractors/{processId}

Gets the status and final output of a form extractor.

Request

URL Parameters

Parameter Description
{processId} The processId which identifies the form extractor process.

Request Headers

Name Description
Accusoft-Affinity-Token The affinityToken of the form extraction process. Required when server clustering is enabled.

Successful Response

Response Body

JSON with metadata about the form extractor process and the final output, if available. You can check on the status of the form extraction process with additional GET requests.

Error Responses

Status Code JSON errorCode Description
400 "MissingInput" Can occur when clustering is enabled and an Accusoft-Affinity-Token request header was not provided.
404 No form extractor could be found for the given {processId}.
580 "InternalError" The server encountered an internal error when handling the request.

Example

Request

GET /v2/formExtractors/gLoltqCVnRKzXz2QFNptqw
Accusoft-Affinity-Token: D+Rmn9kB4FrLfrHoNL2bag6WpuNn2ox2qhT2GbLdf9A=

Response

HTTP/1.1 200 OK
Content-Type: application/json

{
  "input": {
    "fileId": "-eo_zmq3qmPS0WKZlP_Lug",
    "formType": "acroform"
  },
  "output": {
    "acroform": {
      "pages": [
        {
          "page": 1,
          "height": 792,
          "width": 612,
          "fields": [
            {
              "fieldType": "Text",
              "name": "email",
              "required": true,
              "tabOrder": 0,
              "appearance": {
                "textColor": "0 g",
                "font": "Helvetica"
              },
              "boundingBox": {
                "lowerLeftX": 89,
                "lowerLeftY": 646,
                "upperRightX": 239,
                "upperRightY": 668
              },
              "options": {
                "multiline": false,
                "maxLen": -1
              },
              "format": {
                "formatCategory": "None"
              }
            },
            {
              "fieldType": "Text",
              "name": "fullName",
              "required": false,
              "tabOrder": 1,
              "appearance": {
                "textColor": "0 g",
                "font": "Helvetica"
              },
              "boundingBox": {
                "lowerLeftX": 89,
                "lowerLeftY": 676,
                "upperRightX": 239,
                "upperRightY": 698
              },
              "options": {
                "multiline": false,
                "maxLen": -1
              },
              "format": {
                "formatCategory": "None"
              }
            }
          ]
        }
      ]
    }
  },
  "expirationDateTime": "2016-10-11T03:30:33.166Z",
  "percentComplete": 100,
  "processId": "gLoltqCVnRKzXz2QFNptqw",
  "state": "complete",
  "affinityToken": "D+Rmn9kB4FrLfrHoNL2bag6WpuNn2ox2qhT2GbLdf9A="
}

"acroform" Output

The output.acroform object will conform to the following. All properties are always present unless otherwise noted:

Fill Color Strings

A string of one or more numbers followed by an operator indicating what the numbers represent:

Date Format Strings

Date format strings use the following special substitution patterns:

All other characters are considered literal punctuation for the format string. The special characters used above may be used literally by escaping them with a backslash.

"rasterForm" Output

The output.rasterForm object will conform to the following. All properties are always present unless otherwise noted:

 

 


©2016. Accusoft Corporation. All Rights Reserved.

Send Feedback