Out of bounds error when creating a document package
Tuesday, February 4, 2020 at 04:56pmHello,
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
Reply to: Out of bounds error when creating a document package
Tuesday, February 4, 2020 at 09:56pmHi 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
Reply to: Out of bounds error when creating a document package
Wednesday, February 5, 2020 at 02:52pmDuo,
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
Reply to: Out of bounds error when creating a document package
Wednesday, February 5, 2020 at 02:53pmIt's my pleasure to help! ;)
Duo