Microsoft Windows Phone 8.1 support ends (13 Jul 2017)

Microsoft has ended support for Windows Phone 8.1

Questions about Android development and PDF

Ink Annotation

More
9 years 3 months ago #11528 by mrawy
Replied by mrawy on topic Ink Annotation
The documentation says node types are:
www.radaeepdf.com/documentation/javadocs...GetNode-int-float:A-
0: move to
1: line to
3: curve to, index, index + 1, index + 2 are all data
4: close operation
But i have only a 3 types of node: 0, 1 and 2.
I think there is something wrong.
And please can you provide code sample.
More
9 years 3 months ago - 9 years 2 months ago #11548 by nermeen
Replied by nermeen on topic Ink Annotation
Sorry it's an error in the javadoc, below you can find an example on how to read the ink path:
Code:
if(annot != null && annot.GetType() == 15) { Path inkPath = annot.GetInkPath(); float pt1[] = new float[2]; float pt2[] = new float[2]; int index = 0; int cnt = inkPath.GetNodeCount(); while( index < cnt ) { int op = inkPath.GetNode(index, pt1); switch( op ) { case 1: //line to Log.i("---INK---", "-- line to " + pt1[0] + ", " + pt1[1]); index++; break; case 2: //curve to inkPath.GetNode(index + 1, pt2); float pt3[] = new float[2]; inkPath.GetNode(index + 2, pt3); Log.i("---INK---", "-- curve to " + pt1[0] + ", " + pt1[1] + ", " + pt2[0] + ", " + pt2[1] + ", " + pt3[0] + ", " + pt3[1]); index += 3; break; default: //move to Log.i("---INK---", "-- move to " + pt1[0] + ", " + pt1[1]); index++; break; } } inkPath.Destroy(); }
Last edit: 9 years 2 months ago by nermeen.
Time to create page: 0.342 seconds
Powered by Kunena Forum