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

Add Annotations checkBox, Combo etc. to PDF

More
IP: 146.241.48.160 6 years 3 months ago #15045 by Righetti
Is it possible to add annotations like checkbox combo etc at runtime ?

Thanks in advance
More
More
IP: 146.241.4.215 6 years 3 months ago #15051 by Righetti
I include this preview lib, there are many changes to do, but when I run my App and try to get out the "label" of checkbox , using my function :

public static String getButtonLabel(Document document, Page.Annotation annotation)
{
// *** obj.DictGetItem("AP").DictGetItem("D").DictGetItemTag(1) "Si"

String key = null;

Obj obj = document.Advance_GetObj(annotation.Advance_GetRef());

if (obj != null)
{
Obj dict_AP = obj.DictGetItem("AP");

if (dict_AP != null)
{
Obj dict_N = dict_AP.DictGetItem("N");

for (int i = 0; dict_N != null && i < dict_N.DictGetItemCount(); i++)
{
key = dict_N.DictGetItemTag(i);

if (key != null && key.equalsIgnoreCase("Off") == false)
break;
}
}
}

return key;
}

... sometimes when I call "dict_N.DictGetItemTag(i);" the app crash with the attach exception.

Thanks in advance

Tommaso.
More
IP: 111.196.245.138 6 years 3 months ago #15052 by radaee
do not coding by yourself, there is an exist example.
plz see function com.radaee.reader.PDFTextAct.NewFields():
Code:
private void NewFields(int pageno) { Page page = m_doc.GetPage(pageno); DocFont dfont = m_doc.NewFontCID("Times", 8);//embed in horizontal writing ResFont rfont = page.AddResFont(dfont); PageContent content = new PageContent(); content.Create(); content.SetFillColor(0); page.ObjsStart(); float rect[] = new float[4]; float font_size = 20; float box_size = 20; float text_gap = 5; //2 radiobox for male/female. rect[0] = 20; rect[1] = 630; rect[2] = rect[0] + box_size; rect[3] = rect[1] + box_size; content.TextBegin(); content.TextSetFont(rfont, font_size); content.TextMove(rect[0] + box_size + text_gap, rect[1] + font_size * 0.15f); content.DrawText("Male"); content.TextEnd(); page.AddFieldRadio(rect, "radsex", "Male", null, null); rect[0] = 100; rect[1] = 630; rect[2] = rect[0] + box_size; rect[3] = rect[1] + box_size; content.TextBegin(); content.TextSetFont(rfont, font_size); content.TextMove(rect[0] + box_size + text_gap, rect[1] + font_size * 0.15f); content.DrawText("Female"); content.TextEnd(); page.AddFieldRadio(rect, "radsex", "Female", null, null); //checkbox for married. rect[0] = 20; rect[1] = 600; rect[2] = rect[0] + box_size; rect[3] = rect[1] + box_size; content.TextBegin(); content.TextSetFont(rfont, font_size); content.TextMove(rect[0] + box_size + text_gap, rect[1] + font_size * 0.15f); content.DrawText("Is married?"); content.TextEnd(); page.AddFieldCheck(rect, "chk1", "Married", null, null); //checkbox for parents. rect[0] = 20; rect[1] = 570; rect[2] = rect[0] + box_size; rect[3] = rect[1] + box_size; content.TextBegin(); content.TextSetFont(rfont, font_size); content.TextMove(rect[0] + box_size + text_gap, rect[1] + font_size * 0.15f); content.DrawText("Has children?"); content.TextEnd(); page.AddFieldCheck(rect, "chk2", "Children", null, null); //input textbox. rect[0] = 20; rect[1] = 540; rect[2] = rect[0] + 200; rect[3] = rect[1] + box_size; content.TextBegin(); content.TextSetFont(rfont, font_size); content.TextMove(rect[0], rect[1] + font_size * 0.15f); content.DrawText("Address:"); content.TextEnd(); float tsize[] = content.TextGetSize(rfont, "Address:", font_size, font_size, 0, 0); rect[0] += tsize[0] + text_gap; rect[2] = rect[0] + 200; page.AddFieldEditbox(rect, "txt1", false, false); //combo-box. rect[0] = 20; rect[1] = 510; rect[2] = rect[0] + 200; rect[3] = rect[1] + box_size; content.TextBegin(); content.TextSetFont(rfont, font_size); content.TextMove(rect[0], rect[1] + font_size * 0.15f); content.DrawText("Country:"); content.TextEnd(); tsize = content.TextGetSize(rfont, "Country:", font_size, font_size, 0, 0); rect[0] += tsize[0] + text_gap; rect[2] = rect[0] + 100; page.AddFieldCombo(rect, "Country", new String[]{"England", "Italy", "American", "Japan"}); page.AddContent(content, true); content.Destroy(); page.Close(); }
the label using page content to display texts.
More
IP: 111.196.245.138 6 years 3 months ago - 6 years 3 months ago #15054 by radaee
about the crash:
you donwloaded version may the last version.
this sepcial version may not updated for long time.
plz contact our support.
Last edit: 6 years 3 months ago by radaee.
More
IP: 146.241.4.215 6 years 3 months ago #15055 by Righetti
I remember that I opened a ticket for fix this error with the normal release, and you fix it.

The special version is only a test or will be released in the future? I need to know for implementing special functions in my app

Thanks
Time to create page: 0.494 seconds
Powered by Kunena Forum