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

TOPIC:

Edit text and Note not saving data 9 years 6 months ago #9954

  • gabmor
  • gabmor's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 17
  • Thank you received: 0
Hi, the line returns false and my package is the same of the demo project com.radee.reader, I tested the other functionalities like add line,add rect, add, oval, select, etc. and works fine. this issue with the EditText and the Note is the only that I get with the library.
public void onDismiss()
	{
		Log.d("Reader","onDismiss");
		if( m_edit_type == 1 )//edit box
		{
			EditText edit = (EditText)m_pEdit.getContentView().findViewById(R.id.annot_text);
			Log.d("Reader","Text Edit "+edit.getText().toString());
			m_annot.SetEditText(edit.getText().toString());
			Log.d("Reader", "Annot text " + m_annot.SetEditText(edit.getText().toString()));
			Log.d("Reader", "Annot text "+m_annot.GetEditText());
			m_view.vRenderSync(m_annot_page);
			if( m_listener != null )
				m_listener.OnPageModified(m_annot_page.GetPageNo());
			PDFEndAnnot();
		}
		if( m_edit_type == 2 )//combo
		{
			if( m_sel_index >= 0 )
			{
				m_annot.SetComboItem(m_sel_index);
				m_view.vRenderSync(m_annot_page);
				if( m_listener != null )
					m_listener.OnPageModified(m_annot_page.GetPageNo());
			}
			m_sel_index = -1;
			PDFEndAnnot();
		}
		m_edit_type = 0;
	}

this is the console output

12-10 12:00:29.049 3165-3165/com.radaee.reader D/Reader: onDismiss
12-10 12:00:29.049 3165-3165/com.radaee.reader D/Reader: Text Edit vfgghfy
12-10 12:00:29.049 3165-3165/com.radaee.reader D/Reader: Annot text false
12-10 12:00:29.049 3165-3165/com.radaee.reader D/Reader: Annot text null
The topic has been locked.

Edit text and Note not saving data 9 years 6 months ago #9955

  • gabmor
  • gabmor's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 17
  • Thank you received: 0
any update? or how to fix my problem?
The topic has been locked.

Edit text and Note not saving data 9 years 6 months ago #9956

  • gabmor
  • gabmor's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 17
  • Thank you received: 0
I have changed the code to test more and found something strange, for some reason my annotation type is changing when I tried to edit, I have even tried with other variable and it's the same
private com.radaee.pdf.Page.Annotation m_annot;
    public static com.radaee.pdf.Page.Annotation m_annot2;

public void OnAnnotClicked(PDFVPage vpage, Page.Annotation annot)
    {
        Log.d("Reader","Annotation Click "+annot);
        m_annot_vpage = vpage;
        if(annot!=null) {
            m_annot = annot;
        }
        if(annot!=null){
                    if (annot.GetType() == 1) {//Popup note
                        m_reader.PDFPerformAnnot();
                    }else{
                        if (annot.GetType() == 3) {//EditText
                            m_annot=annot;
                            m_annot2=annot;
                            Log.d("Reader","Gettype==3 "+m_annot2.GetType());
                            Log.d("Reader","Gettype==3 "+m_annot2.SetEditText("aaa"));
                            onEdit2();
                        }
        }

    }
    private void onEdit2()
    {
        final EditText    input  = new EditText(getActivity());
        final AlertDialog dialog = new AlertDialog.Builder(getActivity())
                .setTitle("Edit Text")
                .setView(input)
                .setPositiveButton("Ok", new DialogInterface.OnClickListener() {
                    public void onClick(DialogInterface dialog, int whichButton) {
                        Editable value     = input.getText();
                        String   newValue  = value.toString();

                        Log.d("Reader", "Annot text " + m_annot);
                        Log.d("Reader", "Annot text " + m_annot.GetType());
                        Log.d("Reader", "Annot text " + m_annot.SetEditText(newValue));
                        Log.d("Reader", "Annot text " + m_annot.GetEditText());
                        Log.d("Reader", "Annot text type " + m_annot.GetEditTextFormat());

                        Log.d("Reader", "Annot text " + m_annot2);
                        Log.d("Reader", "Annot text " + m_annot2.GetType());
                        Log.d("Reader", "Annot text " + m_annot2.SetEditText(newValue));
                        Log.d("Reader", "Annot text " + m_annot2.GetEditText());
                        Log.d("Reader", "Annot text type " + m_annot2.GetEditTextFormat());

                        m_reader.PDFEndAnnot();
                        m_reader.updatePage(m_annot_vpage);
                    }
                })
                .setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
                    public void onClick(DialogInterface dialog, int whichButton) {
                        // Do nothing.
                       m_reader.PDFEndAnnot();
                    }
                })
                .setOnCancelListener(new DialogInterface.OnCancelListener() {
                    @Override
                    public void onCancel(DialogInterface dialogInterface) {
                        m_reader.PDFEndAnnot();
                    }
                }).create();
        input.setText(m_annot.GetEditText());
        input.setSelection(input.getText().length());
        input.setSingleLine(true);
        input.setImeOptions(input.getImeOptions() | EditorInfo.IME_FLAG_NO_EXTRACT_UI);
        dialog.show();
    }


12-10 17:36:44.459 23223-23223/com.radaee.reader D/Reader: Annotation Click com.radaee.pdf.Page$Annotation@42312ea8
12-10 17:36:44.459 23223-23223/com.radaee.reader D/Reader: Gettype==3 3
12-10 17:36:44.839 23223-23223/com.radaee.reader D/Reader: Gettype==3 true

12-10 17:36:49.269 23223-23223/com.radaee.reader D/Reader: Annot text com.radaee.pdf.Page$Annotation@42312ea8
12-10 17:36:49.269 23223-23223/com.radaee.reader D/Reader: Annot text 0
12-10 17:36:49.269 23223-23223/com.radaee.reader D/Reader: Annot text false
12-10 17:36:49.269 23223-23223/com.radaee.reader D/Reader: Annot text null
12-10 17:36:49.269 23223-23223/com.radaee.reader D/Reader: Annot text type null
12-10 17:36:49.269 23223-23223/com.radaee.reader D/Reader: Annot text com.radaee.pdf.Page$Annotation@42312ea8
12-10 17:36:49.269 23223-23223/com.radaee.reader D/Reader: Annot text 0
12-10 17:36:49.269 23223-23223/com.radaee.reader D/Reader: Annot text false
12-10 17:36:49.269 23223-23223/com.radaee.reader D/Reader: Annot text null
12-10 17:36:49.269 23223-23223/com.radaee.reader D/Reader: Annot text type null
The topic has been locked.

Edit text and Note not saving data 9 years 6 months ago #9972

  • Davide
  • Davide's Avatar
  • Offline
  • User is blocked
  • User is blocked
  • Posts: 814
  • Thank you received: 65
Hi,
sorry for the delay.
We have sent the issue to our developers.
We'll get back to you as soon as possible..
The topic has been locked.

Edit text and Note not saving data 7 years 1 month ago #13806

  • rishikesh@appristine.in
  • rishikesh@appristine.in's Avatar
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 24
  • Thank you received: 0
Arabic text not adding..english is working fine but arabic text not adding and if you add english and arabic text only english text is showing..

Referred Link : www.radaeepdf.com/support/knowledge-base?view=kb&kbartid=43

For Example : "Hi..it test..." - working fine
"لوحة المفاتيح العربية" - showing nothing
""لوحة المفاتيح العربية Hi..it test... " - only showing Hi..it test...

If i open it in adobe reader irt showing line box and if i tap on it showing arabic text in adobe reader.


Thank you
Last edit: by rishikesh@appristine.in.
The topic has been locked.

Edit text and Note not saving data 7 years 1 month ago #13809

  • nermeen
  • nermeen's Avatar
  • Offline
  • Platinum Member
  • Platinum Member
  • Posts: 962
  • Thank you received: 87
This is a font related problem, you need to set the annotation font to a font that supports also Arabic.

In the demo project you can use (Amiri), by modifying Global.Init(ContextWrapper act, int license_type, String company_name, String mail, String serial) as follows:
setAnnotFont("Amiri-Regular")
instead of
setAnnotFont("DroidSansFallback")

In your project make sure to include this font (or other font of your choice) and add it to the font list by adding the following before fontfileListEnd();
load_truetype_font( res, R.raw.amiri_regular, new File(files, "amiriRegular.ttf") );//arabic
The following user(s) said Thank You: rishikesh@appristine.in
The topic has been locked.
Powered by Kunena Forum