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

Bitmap annotation not added in PDF.

More
IP: 192.168.0.71 11 years 3 months ago #7797 by moontech
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;
}
More
IP: 192.168.0.71 11 years 3 months ago - 11 years 3 months ago #7798 by radaee
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:
Code:
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: 11 years 3 months ago by .
More
IP: 192.168.0.71 11 years 3 months ago #7810 by moontech
Yes,
i used this code but first time annotation added in PDF,but second time annotation not added in that PDF.
More
IP: 192.168.0.71 11 years 3 months ago #7811 by moontech
This was PDF file in which bitmap annotation not added
More
IP: 192.168.0.71 11 years 3 months ago #7812 by moontech
Send require code for add bitmap annotation in current page.
it's too urgent.
we got this issue from number of users.
reply here
More
IP: 192.168.0.71 11 years 3 months ago #7813 by radaee
may you attach pdf file, that failed to AddAnnotBitmap?
Time to create page: 0.387 seconds
Powered by Kunena Forum