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

TOPIC:

Bitmap annotation not added in PDF. 9 years 4 months ago #7977

  • nermeen
  • nermeen's Avatar
  • Offline
  • Platinum Member
  • Platinum Member
  • Posts: 962
  • Thank you received: 87
We have tested your code, and it's working fine (the bitmap is added and rendered correctly).
The only difference is the bitmap itself...
How do you initialize it?
Can you try with a bitmap from resources, to make sure that the bitmap itself is the problem?

The bitmap we tested with is the one from the resources of the demo project:
Bitmap bitmap = BitmapFactory.decodeResource(this.getResources(), R.drawable.pdf_icon);

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

Bitmap annotation not added in PDF. 9 years 4 months ago #7986

  • radaee
  • radaee's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 1123
  • Thank you received: 73
there are some condition for AddAnnotBitmap():
1. invoked Document.SetCache(), and only once. you can set debug point in Document.SetCache() to ensure only once invoked.
2. Bitmap pizles format must be RGBA32.
3. Page.ObjsStart or Page.RenderXXX invoked, and Page.Close() not invoked.

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

Bitmap annotation not added in PDF. 9 years 4 months ago #7989

  • moontech
  • moontech's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
  • Posts: 80
  • Thank you received: 0
We have tried with the pdf_icon from demo project.But no effect at all.
Actually this problem occurs when following these steps..
PdfActivity(where add bitmap) -> on save it redirects to Preview Activity -> Back -> PdfActivity(resumes activity).

If I stay on PdfActivity and add bitmap its working ok.
Does above flow effect any object or method?

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

Bitmap annotation not added in PDF. 9 years 4 months ago #7990

  • moontech
  • moontech's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
  • Posts: 80
  • Thank you received: 0
Condition for AddAnnotBitmap():
3. Page.ObjsStart or Page.RenderXXX invoked, and Page.Close() not invoked.

Did you mean than that page.ObjsStart and page.RenderXXX should be invoked every time and do not invoke page.Close() every time?

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

Bitmap annotation not added in PDF. 9 years 4 months ago #7998

  • moontech
  • moontech's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
  • Posts: 80
  • Thank you received: 0
Can we have reply here?
Need to solve this.

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

Bitmap annotation not added in PDF. 9 years 4 months ago #8003

  • radaee
  • radaee's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 1123
  • Thank you received: 73
seems, you'd better send your own project to us.
demo project tested, and working fine.

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

Powered by Kunena Forum