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

page.AddAnnotEditbox is always returning false

More
10 years 7 months ago - 10 years 7 months ago #10244 by max.pfeiffer
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:
Code:
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
Last edit: 10 years 7 months ago by max.pfeiffer.
More
10 years 7 months ago #10272 by max.pfeiffer
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?
More
10 years 7 months ago #10282 by Davide
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 :
Code:
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[])
More
10 years 7 months ago #10285 by max.pfeiffer
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 ....
More
10 years 7 months ago #10286 by support
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.
More
10 years 7 months ago #10303 by max.pfeiffer
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.
Time to create page: 0.416 seconds
Powered by Kunena Forum