Dear Radaee Support Team,
I am trying to add a editBox text annotation. I was not successful so far.
I read the page java docs and the knowledge base article about that topic. According to this I did my implementation:
private boolean onTouchEditBox (MotionEvent event) {
if (m_status != STA_EDIT_BOX) {
return false;
}
switch (event.getActionMasked()) {
case MotionEvent.ACTION_UP: {
PDFPos pos = m_layout.vGetPos((int) event.getX(), (int) event.getY());
VPage vpage = m_layout.vGetPage(pos.pageno);
Page page = m_doc.GetPage(vpage.GetPageNo());
if (page != null) {
page.ObjsStart();
float[] rect = new float[4];
rect[0] = pos.x;
rect[1] = pos.y;
rect[2] = pos.x + 100;
rect[3] = pos.y + 50;
Matrix mat = vpage.CreateInvertMatrix(m_layout.vGetX(), m_layout.vGetY());
mat.TransformRect(rect);
if (page.AddAnnotEditbox(rect, 0x80FF0000, 0, 0x80FF0000, 13, 0x80FF0000)) {
Page.Annotation newAnnot = page.GetAnnot(page.GetAnnotCount() - 1);
newAnnot.SetEditText("Example Text");
}
m_layout.vRenderSync(vpage);
invalidate();
page.Close();
}
break;
}
}
return true;
}
The method call page.AddAnnotEditbox always return false in my case. Also the editbox is not displayed on the screen, which is probably the logical result of this return value.
Java doc states "the added annotation can be obtained by Page.GetAnnot(Page.GetAnnotCount() - 1), if this method return true.". This is what I am doing here.
Is there any restriction in this using page.AddAnnotEditbox without license key? I am just evaluating if these functions work properly in order to buy the premium version.
Can someone please point me in the right direction? I am pretty stuck here.
Greetings,
Max