saida.higuera

Coordinates Using Text Anchors

0 votes

Hello, I need some help understanding how calculate the coordinates for the anchors in a pdf. I'm following this page Using Text Anchors | OneSpan Community Platform but i do not understand how to calculate any of the  .withOffset(10, -30) . If someone can give some help it would be nice. 

 

 


Reply to: Coordinates Using Text Anchors

0 votes

Hi saida.higuera,

 

Below is the Axis Diagram for the offsets:

axis diagram

For example, if you want to move the field lower and to the right side, you'd set both x and y positive.

 

Duo

Duo Liang OneSpan Evangelism and Partner Integrations Developer


Reply to:

0 votes

ok i see that, but for example this case in the link Using Text Anchors | OneSpan Community Platform  newTextAnchor("Signature of the Client")   .atPosition(TextAnchorPosition.TOPLEFT)   .withSize(150, 40)   .withOffset(0, -50)  why -50, and in this one i understand the -175 but  "(hereafter referred to as")   .atPosition(TextAnchorPosition.TOPRIGHT)   .withSize(150, 20)   .withOffset(-175, -5)


Attachments

Reply to: Coordinates Using Text Anchors

0 votes

Hi saida.higuera,

 

I believe the example is to showcase you the differences between the TextAnchorPosition.TOPLEFT vs TOPRIGHT. This is the starting point of the axis, thus choosing TOPRIGHT needs extra offset to the left (negative X value).

 

Duo

Duo Liang OneSpan Evangelism and Partner Integrations Developer


Reply to:

0 votes

hello, thank you for your answer but i'm still do not understand the measures. This page is the only documentation that i have so i understand that is an example that i can use to undertand how to find the coordinates. If i try to see the fild "Signature of the Client" i understant the position but how it is possible that the field "Signature of the Contractor" has the same position ".withOffset(0, -50)" (. Also i'm going to say that i undertand the negative or the positive in the X or Y. but i do not understant how it is posible that the fiel "hereafter referred to as" is placed in the point (175 (i understand),-5) i can not find how the value in -5. 

Please help me to understand how to do this measures.


Reply to:

0 votes

Thanks for the clarification, got your point now! I think the confusion here is, the "hereafter referred to as" with occurrence 0 locates at the first line (not the second occurrence below the field) 

On top of that, from my own tests, seems OneSpan document engine doesn't recognize LEFT vs RIGHT any more and always starts from the LEFT, but TOP vs BOTTOM still works. (Despite of that, I think it will be sufficient if you always stick to TOPLEFT).

 

Duo

Duo Liang OneSpan Evangelism and Partner Integrations Developer


Reply to:

0 votes

Is the coordinate tool from adobe pro a good tool to find the coordinates ? I'm trying to create a package and always have the same error. 

For example in the image you see the coordinates and then i aply the 1.3 factor  and for that field i have 143.716 x and 518.478 in y. But i send this values and it gives me an error so i really do not what am i doing wrong. 


Attachments

Reply to:

0 votes

What's the error message? If you consistently encountered the same error, you could try below steps to narrow down the cause of issue:

(1)Try uploading the PDF via UI portal (e.g. https://sandbox.esignlive.com/a/login), it's handy to verify if the PDF itself is supported by OSS

(2)Try to remove the API/SDK code which regards to text anchors - probably to use hardcoded coordinates instead

(3)Try to specify different offsets for the text anchors 

 

Duo

Duo Liang OneSpan Evangelism and Partner Integrations Developer


Reply to:

0 votes

I see. If it's an ADA compliant PDF, I believe Text Anchor won't work in this case, and the ONLY supported way to place signatures and fields is to use Position Extraction. 

Please kindly refer to my blog "Upload Accessible Document in Sender UI", the blog is about the UI flow, but the sample PDF gives you an idea how to add and name the PDF forms. If you are interested in this approach, I can provide the equivalent SDK code in a short time.

 

Duo

Duo Liang OneSpan Evangelism and Partner Integrations Developer


Reply to:

0 votes

Thank you, in fact i follow the blog to know how to use the accesibility in the UI portal. And i know that this PDF works in the Ui, But now we want to have the same functionality in the Java SDK so ths is why i'm tryning to send the anchor. I did not know that with anchos this is not going to work.


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