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

TOPIC:

AddAnnotBitmap is not work on my app. 9 years 6 months ago #7323

  • oemilk
  • oemilk's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 28
  • Thank you received: 0
I have tested this method(AddAnnotBitmap).
It works well.

But when I tested it on my app, it doesn't work....

My app is professional license.
I don't know the reason.

Log.e("success", "count: " + page.GetAnnotCount() + " / success : " + success);
count is 0, success is true.

Page page = mDoc.GetPage(1);
page.ObjsStart();
float rect[] = new float[4];
rect = new float[] { 200, 200, 241, 241 };
boolean success= page.AddAnnotBitmap(bmAddnot, true, rect);
Log.e("success", "count: " + page.GetAnnotCount() + " / success : " + success);
mPDFView.vRenderSync(mPDFView.vGetPage(1));
invalidate();
page.Close();

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

AddAnnotBitmap is not work on my app. 9 years 6 months ago #7330

  • Davide
  • Davide's Avatar
  • Offline
  • User is blocked
  • User is blocked
  • Posts: 814
  • Thank you received: 65
Hi,
you need to rerender the page after your code.
You have to recall the object page after the rendering to get the correct page.GetAnnotCount().

Check this:
www.androidpdf.mobi/forum/ios-dev/1791-a...t-work-in-2-2-0#6371

and this:
www.androidpdf.mobi/forum/Android-develo...imitstart=0&start=12

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

AddAnnotBitmap is not work on my app. 9 years 6 months ago #7367

  • oemilk
  • oemilk's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 28
  • Thank you received: 0
What are the "recall the object page" and "rerender the page" ?
Can you give me some sample codes?

Other api methods are done. (AddAnnotMarkup(), AddAnnotStamp() ... )
I don't understand your link...

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

Last edit: by EugeneP.

AddAnnotBitmap is not work on my app. 9 years 6 months ago #7376

  • Davide
  • Davide's Avatar
  • Offline
  • User is blocked
  • User is blocked
  • Posts: 814
  • Thank you received: 65
Hi,

- invoke PDFView.vRenderAsync(PDFVPage page) to rerender page after page modified

- Page page = mDoc.GetPage(1);
page.ObjsStart();
Log.e("success", "count: " + page.GetAnnotCount() + " / success : " + success);

to recall the object page after the rendering to get the correct page.GetAnnotCount()

In the links you can see some example of AddAnnotationBitmap and you can read some advice to do it properly.

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

  • Page:
  • 1
Powered by Kunena Forum