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 #7797

  • moontech
  • moontech's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
  • Posts: 80
  • Thank you received: 0
i used this code.
But in some PDF annoation added but in some PDF no added.
But some time annotation added in that file.
I can't under stand for real issue
reply here,it's urgent call.

m_doc.SetCache(Global.tmp_path + "/temp.dat");
int c_page = Constant.currentpage;
pa = m_doc.GetPage(c_page);
pa.ObjsStart();
PDFVPage vpage = m_rPDF.m_view.vGetPage(c_page);
m_rPDF.m_view.vRender(vpage);
float[] rect = { 200, 200, (200 + bitmap.getWidth()),
(200 + bitmap.getHeight()) };
boolean b = pa.AddAnnotBitmap(bitmap, true, rect);
int count = pa.GetAnnotCount();
Log.e("TAG", b+ " annoation Annot count" + count);
float m_ratio = ((float) m_doc.GetPageHeight(c_page))
/ ((float) m_doc.GetPageWidth(c_page));
Matrix mat = new Matrix(m_ratio, -m_ratio, 0,
m_doc.GetPageHeight(c_page) * m_ratio);
int dib = Global.dibGet(0, (int) m_doc.GetPageWidth(c_page),
(int) m_doc.GetPageHeight(c_page));
pa.RenderPrePare(dib);
pa.RenderToBmp(bitmap, mat);
m_rPDF.m_view.vRender(vpage);
if (bitmap != null && !bitmap.isRecycled()) {
bitmap.recycle();
bitmap = null;
}

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

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

  • radaee
  • radaee's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 1123
  • Thank you received: 73
1. Global.tmp_path + "/temp.dat" only can be used in 1 document object, the second document shall failed.
2. to be sure Constant.currentpage has exist in all PDF file.
3. to be sure (200, 200, 200 + bmp.width, 200 + bmp.height) are all at page area.
codes like:
m_doc.Open(...);
m_doc.SetCache(Global.tmp_path + "/temp.dat");
Page page = m_doc.GetPage(pageno);
page.ObjsStart();
page.AddAnnotBitmap(bmp);
Bitmap bmp_render = Bitmap.Create(...RGBA32);
bmp_rendr.erase(back_color);
page.RenerToBmp(bmp_render);
page.Close();
bmp_rendr.recycle();
m_doc.Close();

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

Last edit: by .

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

  • moontech
  • moontech's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
  • Posts: 80
  • Thank you received: 0
Yes,
i used this code but first time annotation added in PDF,but second time annotation not added in that PDF.

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

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

  • moontech
  • moontech's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
  • Posts: 80
  • Thank you received: 0
This was PDF file in which bitmap annotation not added

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

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

  • moontech
  • moontech's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
  • Posts: 80
  • Thank you received: 0
Send require code for add bitmap annotation in current page.
it's too urgent.
we got this issue from number of users.
reply here

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

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

  • radaee
  • radaee's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 1123
  • Thank you received: 73
may you attach pdf file, that failed to AddAnnotBitmap?

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

Powered by Kunena Forum