- Posts: 1123
- Thank you received: 73
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.
IP: 192.168.0.71
11 years 3 months ago #7966
by radaee
Replied by radaee on topic Bitmap annotation not added in PDF.
yes, only exists at last beta or later.
IP: 192.168.0.71
11 years 3 months ago #7971
by moontech
Replied by moontech on topic Bitmap annotation not added in PDF.
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.
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.
IP: 192.168.0.71
11 years 3 months ago - 11 years 3 months ago #7972
by radaee
Replied by radaee on topic Bitmap annotation not added in PDF.
here is piece codes in PDFReader:
where touch_x1, touch_y1, touch_x2, touch_y2 is in screen x,y.
touch_x2 > touch x1 and touch_y2 > touch_y1
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);
}
touch_x2 > touch x1 and touch_y2 > touch_y1
Last edit: 11 years 3 months ago by .
IP: 192.168.0.71
11 years 3 months ago #7974
by moontech
Replied by moontech on topic Bitmap annotation not added in PDF.
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.
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.
IP: 192.168.0.71
11 years 3 months ago #7975
by radaee
Replied by radaee on topic Bitmap annotation not added in PDF.
m_doc.SetCache(Global.tmp_path + "/temp.dat"); can't invoke multi-times.
only once m_doc.SetCache can be invoked, for each Document.
only once m_doc.SetCache can be invoked, for each Document.
IP: 192.168.0.71
11 years 3 months ago #7976
by moontech
Replied by moontech on topic Bitmap annotation not added in PDF.
Now invoking this only once after this
m_doc.Open(val, null);
Still same problem..
m_doc.Open(val, null);
Still same problem..
Time to create page: 0.385 seconds