Signin/Signup with: 
Welcome, Guest
Username: Password: Remember me
Questions about Android development and PDF

TOPIC:

Ink Annotation 11 years 2 months ago #1334

  • msj
  • msj's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 3
  • Thank you received: 0
Can I get points of Ink Annotation?

Please Log in or Create an account to join the conversation.

Ink Annotation 11 years 2 months ago #1335

  • radaee
  • radaee's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 1123
  • Thank you received: 73
yes, you can invoke:
Ink.GetNodeCount();
Ink.GetNode( int index, float[] pt );
draw on canvas like:
	public void OnDraw(Canvas canvas)
	{
		int index = 0;
		int cnt = getNodeCount(hand);
		float pt1[] = new float[2];
		float pt2[] = new float[2];
		Paint paint = new Paint();
		Path path = new Path();
		paint.setStrokeCap(Cap.ROUND);
		paint.setStrokeJoin(Join.ROUND);
		paint.setStrokeWidth(width);
		paint.setColor(color);
		paint.setStyle(Style.STROKE);
		paint.setAntiAlias(true);
		path.reset();
		while( index < cnt )
		{
			int op = getNode( hand, index, pt1 );
			switch( op )
			{
			case 1:
				path.lineTo(pt1[0], pt1[1]);
				index++;
				break;
			case 2:
				getNode( hand, index + 1, pt2 );
				path.quadTo(pt1[0], pt1[1], pt2[0], pt2[1]);
				index += 2;
				break;
			default:
				path.moveTo(pt1[0], pt1[1]);
				index++;
				break;
			}
		}
		canvas.drawPath(path, paint);
	}

Please Log in or Create an account to join the conversation.

Last edit: by .

Ink Annotation 11 years 2 months ago #1346

  • msj
  • msj's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 3
  • Thank you received: 0
Thanks for your answer.

Then I want to get saved Ink Annotations in document. But I could not find the method.

Help me, please!

Please Log in or Create an account to join the conversation.

Ink Annotation 11 years 2 months ago #1349

  • radaee
  • radaee's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 1123
  • Thank you received: 73
oh, you can't get Ink object from saved PDF.
you can just get Annotation and check annotation type by:
- Page.GetAnnot
- Page.GetAnnotType()

Please Log in or Create an account to join the conversation.

Ink Annotation 11 years 2 months ago #1352

  • msj
  • msj's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 3
  • Thank you received: 0
Would you make it possible to get ink object from saved document?

Please Log in or Create an account to join the conversation.

Ink Annotation 11 years 2 months ago #1354

  • radaee
  • radaee's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 1123
  • Thank you received: 73
NO, i think not.
i think you may save some data out of PDF, which using to contruct Ink object.

Please Log in or Create an account to join the conversation.

Last edit: by .
Powered by Kunena Forum