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

TOPIC:

page.AddAnnotEditbox is always returning false 8 years 2 months ago #10244

  • max.pfeiffer
  • max.pfeiffer's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 14
  • Thank you received: 1
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

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

Last edit: by max.pfeiffer.

page.AddAnnotEditbox is always returning false 8 years 2 months ago #10272

  • max.pfeiffer
  • max.pfeiffer's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 14
  • Thank you received: 1
Dear support,
thank you very much for your quick reply.

After some hours of work I found out that it was a license problem. I didn`t set the package name to com.radaee.reader.

Why is that information hidden in the knowledge base? Why isn`t there any "How to get started" page on your web site?
This is really a bad way of documentation. I just found that by chance.

After doing that, page.AddAnnotEditbox works fine.

But now I have the same problem with page.AddAnnotBitmap. My code works fine in the demo project. But when I cut and paste the same function in my project page.AddAnnotBitmap always returns false. Package name is set to com.radaee.reader.

Is there a bug in the license handling?

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

page.AddAnnotEditbox is always returning false 8 years 2 months ago #10282

  • Davide
  • Davide's Avatar
  • Offline
  • User is blocked
  • User is blocked
  • Posts: 814
  • Thank you received: 65
Hi,
probably this is the knowledge base article you were looking for : www.radaeepdf.com/support/knowledge-base...=component&kbartid=4

About the AddAnnotBitmap issue, are you setting the cache before calling that method?
Something like that :
m_doc.SetCache( Global.tmp_path + "/temp.dat" );//set temporary cache for editing.
For more info please check this www.radaeepdf.com/documentation/javadocs....html#AddAnnotBitmap(Bitmap, boolean, float[])
The following user(s) said Thank You: max.pfeiffer

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

page.AddAnnotEditbox is always returning false 8 years 2 months ago #10285

  • max.pfeiffer
  • max.pfeiffer's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 14
  • Thank you received: 1
Hi David,

thank you very much for pointing me in the right direction: m_doc.SetCache did the job.
I didn't know that setting the cache is mandatory for adding images.

Is this true only for images? page.AddAnnotEditbox worked fine without cache. Why is that so?

Seriously: you need better documentation. The important pieces of information are cluttered all over your website. Why don't you put together a "get started page" wich contains the complete information which is needed to get started with your library?
You could probably sell more licenses when your documentation would be better. It was really a pain and took me 4 work days to understand how to use your library properly. This could optimised severely ....

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

page.AddAnnotEditbox is always returning false 8 years 2 months ago #10286

  • support
  • support's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 692
  • Thank you received: 59
Thank you Max for your suggestions.
We're aware about our actual weakness (documentation, well done xamarin integration, good ready to be integrated PDF reader) as our tool started as a all purpose PDF rendering and manipulating API and was addressed, particularly, to skilled developers.
Right now the border between "skilled developers" and "developers who needs quickly to go on the market" is really thin.

About our actual activities:
- we're improving iOS xamarin and ready to be run reader. It's an internal release but we share it with customers who are looking for it
- improving Android performances and clean the code, mostly optimizing speed/memory consumption rate

After that we will start:
- Android official xamarin interface and ready to be included reader
- improving documentation

It's quite a long process and we are approaching it trying not to alter our price list: providing free support and perpetual update require us a big effort.

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

page.AddAnnotEditbox is always returning false 8 years 2 months ago #10303

  • max.pfeiffer
  • max.pfeiffer's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 14
  • Thank you received: 1
Thank you for your further information. I bought the premium license for our customer yesterday. This is now the fourth project where we use your library.

I would really appreciate if you could beef up your documentation. It would help a lot if your java classes you ship with your viewlib would be more structured and readable. More comments would be nice there also.

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

  • Page:
  • 1
Powered by Kunena Forum