RadaeePDF.com :: Topic: Bitmap annotation not added in PDF. (1/10)
Welcome, Guest
Username: Password: Remember me

Signin/Signup with:

Questions about Android development and PDF

TOPIC: Bitmap annotation not added in PDF.

Bitmap annotation not added in PDF. 3 years 49 minutes ago #7797

  • moontech
  • moontech's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 80
  • Karma: 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;
}
The administrator has disabled public write access.

Bitmap annotation not added in PDF. 2 years 11 months ago #7798

  • radaee
  • radaee's Avatar
  • OFFLINE
  • Moderator
  • Posts: 825
  • Thank you received: 10
  • Karma: 43
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();
Last Edit: 2 years 11 months ago by .
The administrator has disabled public write access.

Bitmap annotation not added in PDF. 2 years 11 months ago #7810

  • moontech
  • moontech's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 80
  • Karma: 0
Yes,
i used this code but first time annotation added in PDF,but second time annotation not added in that PDF.
The administrator has disabled public write access.

Bitmap annotation not added in PDF. 2 years 11 months ago #7811

  • moontech
  • moontech's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 80
  • Karma: 0
This was PDF file in which bitmap annotation not added
The administrator has disabled public write access.

Bitmap annotation not added in PDF. 2 years 11 months ago #7812

  • moontech
  • moontech's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 80
  • Karma: 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
The administrator has disabled public write access.

Bitmap annotation not added in PDF. 2 years 11 months ago #7813

  • radaee
  • radaee's Avatar
  • OFFLINE
  • Moderator
  • Posts: 825
  • Thank you received: 10
  • Karma: 43
may you attach pdf file, that failed to AddAnnotBitmap?
The administrator has disabled public write access.
Powered by Kunena Forum