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 #7966 by radaee
yes, only exists at last beta or later.
More
IP: 192.168.0.71 11 years 3 months ago #7971 by moontech
We can't found above methods.
And we need code for addBitmap annotation in PDF using Bitmap object.
So send actual code which work for Bitmap annotation.

Note:
In our application we used three types annotation.
1 Text
2 ink
3 Bitmap

above two working well but bitmap annotation not added in PDF.
Some time annotation added with blank bitmap.
means bitmap not displaying on PDF but rectangle of bitmap displaying.
More
IP: 192.168.0.71 11 years 3 months ago - 11 years 3 months ago #7972 by radaee
here is piece codes in PDFReader:
Code:
PDFPos pos = m_view.vGetPos(touch_x1, touch_y1); PDFVPage vpage = m_view.vGetPage(pos.pageno); Page page = vpage.GetPage(); if( page != null ) { Matrix mat = vpage.CreateInvertMatrix(m_view.vGetX(), m_view.vGetY()); float rect[] = new float[4]; rect[0] = touch_x1; rect[1] = touch_y1; rect[2] = touch_x2; rect[3] = touch_y2; mat.TransformRect(rect); page.AddAnnotBitmap(m_icon, true, rect); mat.Destroy(); m_view.vRenderSync(vpage); }
where touch_x1, touch_y1, touch_x2, touch_y2 is in screen x,y.
touch_x2 > touch x1 and touch_y2 > touch_y1
Last edit: 11 years 3 months ago by .
More
IP: 192.168.0.71 11 years 3 months ago #7974 by moontech
We tried above code but still same issue.
We are using code as below.

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);
float[] rect = { 200, 200, (200 + bitmap.getWidth()),
(200 + bitmap.getHeight()) };
pa.AddAnnotBitmap(bitmap, true, rect);
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);

pa.RenderToBmp(bitmap, mat);
m_rPDF.m_view.vRenderSync(vpage);
pa.Close();
mat.Destroy();
bitmap.recycle();

Please let us know what modification it needs.
More
IP: 192.168.0.71 11 years 3 months ago #7975 by radaee
m_doc.SetCache(Global.tmp_path + "/temp.dat"); can't invoke multi-times.
only once m_doc.SetCache can be invoked, for each Document.
More
IP: 192.168.0.71 11 years 3 months ago #7976 by moontech
Now invoking this only once after this
m_doc.Open(val, null);

Still same problem..
Time to create page: 0.385 seconds
Powered by Kunena Forum