aaronstine | Posts: 8

Out of bounds error when creating a document package

0 votes

Hello,

We're using the .NET SDK for OneSpan Sign. When creating a package, we're receiving a message that we've placed an object (presumably the signature) outside the page boundary. The full error details from the SDK are below.

The remote server returned an error: (400) Bad Request. HTTP POST on URI https://servername/api/packages/5O5NeIZfqURxt6MS6Uv1PVYCzqs=/documents. Optional details: {"code":400,"messageKey":"error.validation.invalidPageLocation","message":"Invalid position. Object placed outside of document page boundary.","name":"Validation Error"}

We checked the coordinates we're sending via the SDK to ensure they are correct. Here's the coordinate's we are sending.

      "Signatures": [
        {
          "xPos": 61,
          "yPos": 275,
          "height": 18,
          "width": 355
        }

Assuming 96 DPI, those coordinates translate to inches as follows:

xPos: 0.064 
yPos: 2.88 
Height: 0.19
Width: 3.70

Those coordinates should place the signature on an 8.5x11 pdf page. But we still receive the error above. So in the interest of trying to solve the problem, we used Fiddler to monitor the network traffic being transmitted from the SDK to the OneSpan server. Here's the data we see being transmitted to the REST endpoint:

{
  "approvals": [
    {
      "fields": [
        {
          "extract": false,
          "height": 18,
          "left": 61,
          "name": "CUSTOMERS NAME",
          "page": 1,
          "subtype": "FULLNAME",
          "top": 275,
          "type": "SIGNATURE",
          "width": 355
        }
      ],
      "role": "PrimarySigner"
    }
  ],
  "data": {},
  "extract": false,
  "extractionTypes": [],
  "fields": [],
  "id": "22-14452865",
  "index": 0,
  "name": "Name of Form to be Signed.pdf",
  "pages": []
}

Again, the coordinates look correct. Do you see what we're missing here? Thanks for you help!

- Aaron Stine


Duo_Liang | Posts: 3776

Reply to: Out of bounds error when creating a document package

0 votes

Hi Aaron,

The x/y coordinates and the height/width look fine to me, and they should make the field within the middle of a 8.5*11 inches page. The only thing I noticed is the "page" attribute, the page starts from 0, so page 1 required a document with at least 2 pages. Could we make sure that the document is at least that long?

 

Duo


aaronstine | Posts: 8

Reply to: Out of bounds error when creating a document package

0 votes

Duo,

That was it. You nailed it! It turned out there was a bug in our code that would occasionally case an "off by one" issue with the page number.

Thanks very much.

- Aaron 


Duo_Liang | Posts: 3776

Reply to: Out of bounds error when creating a document package

0 votes

It's my pleasure to help! ;)

 

Duo


Hello! Looks like you're enjoying the discussion, but haven't signed up for an account.

When you create an account, we remember exactly what you've read, so you always come right back where you left off