Error on restore Ink annotation -
Signin/Signup with: 
Welcome, Guest
Username: Password: Remember me
Questions about Android development and PDF
  • Page:
  • 1

TOPIC: Error on restore Ink annotation

Error on restore Ink annotation 1 year 9 months ago #12890

  • rpc_1910
  • rpc_1910's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 6
  • Thank you received: 0
I'm having a problem adding annotations like Ink. When I create the annotation I am storing in an external file the coordinates so that I can re-create the annotation.

When you insert the annotation and update your RECT, the annotation becomes transparent, as shown in the image. When I do not update the RECT of the annotation it is displayed in the wrong place.

Correct annotation -

Annotation inserted without updating RECT -

Annotation inserted updating the RECT -

Here is the snippet of code used to re-create the annotation:

m_ink = new Ink(8);

m_ink.OnDown(75f, 747f);
m_ink.OnMove(78f, 736f);
m_ink.OnMove(79f, 722f);
m_ink.OnMove(85f, 701f);
m_ink.OnMove(92f, 670f);
m_ink.OnMove(103f, 639f);
m_ink.OnMove(117f, 614f);
m_ink.OnMove(125f, 600f);
m_ink.OnMove(133f, 591f);
m_ink.OnMove(139f, 585f);
m_ink.OnMove(145f, 582f);
m_ink.OnMove(147f, 583f);
m_ink.OnMove(147f, 593f);
m_ink.OnMove(143f, 610f);
m_ink.OnMove(137f, 632f);
m_ink.OnMove(133f, 656f);
m_ink.OnMove(129f, 677f);
m_ink.OnMove(127f, 699f);
m_ink.OnMove(125f, 722f);
m_ink.OnMove(123f, 745f);
m_ink.OnMove(122f, 761f);
m_ink.OnMove(122f, 775f);
m_ink.OnMove(122f, 788f);
m_ink.OnMove(122f, 800f);
m_ink.OnMove(125f, 820f);
m_ink.OnMove(128f, 827f);
m_ink.OnMove(133f, 833f);
m_ink.OnMove(137f, 838f);
m_ink.OnMove(149f, 839f);
m_ink.OnMove(155f, 836f);
m_ink.OnMove(162f, 825f);
m_ink.OnMove(172f, 809f);
m_ink.OnMove(182f, 793f);
m_ink.OnMove(192f, 772f);
m_ink.OnMove(214f, 740f);
m_ink.OnMove(222f, 730f);
m_ink.OnMove(232f, 722f);
m_ink.OnMove(239f, 717f);
m_ink.OnMove(243f, 714f);
m_ink.OnMove(246f, 713f);
m_ink.OnMove(248f, 713f);
m_ink.OnMove(249f, 722f);
m_ink.OnMove(246f, 733f);
m_ink.OnMove(239f, 749f);
m_ink.OnMove(233f, 767f);
m_ink.OnMove(226f, 786f);
m_ink.OnMove(221f, 802f);
m_ink.OnMove(214f, 831f);
m_ink.OnMove(212f, 847f);
m_ink.OnMove(211f, 860f);
m_ink.OnMove(211f, 872f);
m_ink.OnMove(211f, 885f);
m_ink.OnMove(212f, 889f);
m_ink.OnMove(216f, 891f);
m_ink.OnMove(227f, 892f);
m_ink.OnMove(237f, 891f);
m_ink.OnMove(248f, 885f);
m_ink.OnMove(260f, 873f);
m_ink.OnMove(290f, 847f);
m_ink.OnMove(310f, 828f);
m_ink.OnMove(345f, 799f);
m_ink.OnMove(365f, 786f);
m_ink.OnMove(394f, 771f);
m_ink.OnMove(407f, 765f);
m_ink.OnMove(416f, 761f);
m_ink.OnMove(423f, 759f);
m_ink.OnMove(428f, 759f);
m_ink.OnMove(431f, 759f);
m_ink.OnMove(432f, 771f);
m_ink.OnMove(419f, 800f);
m_ink.OnMove(412f, 817f);
m_ink.OnMove(396f, 846f);
m_ink.OnMove(391f, 859f);
m_ink.OnMove(384f, 886f);
m_ink.OnMove(381f, 897f);
m_ink.OnMove(379f, 910f);
m_ink.OnMove(379f, 915f);
m_ink.OnMove(381f, 916f);
m_ink.OnMove(388f, 914f);
m_ink.OnMove(416f, 895f);
m_ink.OnMove(433f, 883f);
m_ink.OnMove(449f, 866f);
m_ink.OnMove(469f, 847f);
m_ink.OnMove(503f, 809f);
m_ink.OnMove(519f, 791f);
m_ink.OnMove(550f, 753f);
m_ink.OnMove(577f, 723f);
m_ink.OnMove(585f, 715f);
m_ink.OnMove(600f, 704f);
m_ink.OnMove(610f, 696f);
m_ink.OnMove(615f, 692f);
m_ink.OnMove(617f, 690f);
m_ink.OnUp(619f, 688f);

Page page = m_doc.GetPage(0);
VPage vpage = m_layout.vGetPage(0);

Matrix mat = vpage.CreateInvertMatrix(m_layout.vGetX(), m_layout.vGetY());

Annotation mAnnot = page.GetAnnot(page.GetAnnotCount()-1);

if(mAnnot != null) {
	mAnnot.SetRect(33.80487f, 79.15289f, 371.0294f, 498.8284f);


Any idea why this is happening?


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

Last edit: by rpc_1910.

Error on restore Ink annotation 1 year 9 months ago #12892

  • nermeen
  • nermeen's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 868
  • Karma: 23
  • Thank you received: 71
Did you try using the example illustrated in Export an Ink annotation and recreate it from path ?

Note; If you have a premium license, you can use the new methods introduced since version 3.14.1, but these methods uses unreadable binary stream

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

  • Page:
  • 1
Powered by Kunena Forum