- Posts: 962
- Thank you received: 87
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
Eraser of PDF Ink
IP: 192.168.0.158
12 years 2 months ago #4884
by nermeen
Replied by nermeen on topic Eraser of PDF Ink
make sure to rerender the page after adding the annotation..i've tested your code and it's working..
Code:
Bitmap bmAddnot = BitmapFactory.decodeResource(getResources(), R.drawable.ic_launcher);
float[]rect = new float[]{0, 0, bmAddnot.getWidth(), bmAddnot.getHeight()};
PDFView m_view = m_vPDF.PDFgetView();
PDFVPage v_page = m_view.vGetPage(m_page_no);
Matrix mat = v_page.CreateInvertMatrix(m_view.vGetX(), m_view.vGetY());
mat.TransformRect(rect);
vpage.GetPage().AddAnnotBitmap(bmAddnot, true, rect);
m_vPDF.invalidate();
IP: 192.168.0.70
12 years 2 months ago #4886
by el3ony
Replied by el3ony on topic Eraser of PDF Ink
After I added m_vPDF.invalidate(); it still show nothing on screen just only PDF
I also tried with PDFReaderOldAct
Page page = m_doc.GetPage(0);
page.ObjsStart();
float[] rect = new float[4];
rect[0] = 0;
rect[1] = 0;
rect[2] = 100;
rect[3] = 100; page.AddAnnotBitmap(BitmapFactory.decodeResource(getResources(), R.drawable.ic_launcher), false, rect);
m_doc.Save();
m_vPDF.invalidate();
there is no icon showing. What did I miss ?
I also tried with PDFReaderOldAct
Page page = m_doc.GetPage(0);
page.ObjsStart();
float[] rect = new float[4];
rect[0] = 0;
rect[1] = 0;
rect[2] = 100;
rect[3] = 100; page.AddAnnotBitmap(BitmapFactory.decodeResource(getResources(), R.drawable.ic_launcher), false, rect);
m_doc.Save();
m_vPDF.invalidate();
there is no icon showing. What did I miss ?
IP: 192.168.0.158
12 years 2 months ago #4887
by nermeen
Replied by nermeen on topic Eraser of PDF Ink
Are you trying with the demo project, or yours? if yours do you have the professional or premium license??
Does the method page.AddAnnotBitmap returns true?
Does the method page.AddAnnotBitmap returns true?
IP: 192.168.0.70
12 years 2 months ago #4888
by el3ony
Replied by el3ony on topic Eraser of PDF Ink
Both but I haven't use the license yet because I haven't finish my feature so I make a duplicate project and try with the same package name of demo project com.radaee.reader. If my understanding was right it should enable all of the feature like premium license right ?
addAnnotBitmap always return true with my duplicate project.
addAnnotBitmap always return true with my duplicate project.
IP: 192.168.0.70
12 years 2 months ago #4889
by radaee
like this?
to be notice: Bitmap object must be ARGB_8888 format.
Replied by radaee on topic Eraser of PDF Ink
Code:
Bitmap bmAddnot = BitmapFactory.decodeResource(getResources(), R.drawable.ic_launcher);
float[]rect = new float[]{0, 0, bmAddnot.getWidth(), bmAddnot.getHeight()};
PDFView m_view = m_vPDF.PDFgetView();
PDFVPage v_page = m_view.vGetPage(m_page_no);
Matrix mat = v_page.CreateInvertMatrix(m_view.vGetX(), m_view.vGetY());
mat.TransformRect(rect);
vpage.GetPage().AddAnnotBitmap(bmAddnot, true, rect);
m_view.vRender(vpage);
m_vPDF.invalidate();
to be notice: Bitmap object must be ARGB_8888 format.
IP: 192.168.0.70
12 years 2 months ago #4891
by el3ony
Replied by el3ony on topic Eraser of PDF Ink
Yes. Even when I created Bitmap object
I created like this Bitmap.createBitmap(bmWidth, bmHeight, Bitmap.Config.ARGB_8888);
Previous snippet code it's just for testing with default icon of project but it doesn't show anything.
I created like this Bitmap.createBitmap(bmWidth, bmHeight, Bitmap.Config.ARGB_8888);
Previous snippet code it's just for testing with default icon of project but it doesn't show anything.
Time to create page: 0.391 seconds