Signin/Signup with: 
Welcome, Guest
Username: Password: Remember me
Questions about Android development and PDF

TOPIC:

Eraser of PDF Ink 7 years 1 month ago #4892

  • el3ony
  • el3ony's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 16
  • Thank you received: 0
For just in case I want to inform you that I cannot add rect annotation either.
I try to use addAnnotRect but there is no rect showing after I added

Here is my 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_vPDF.PDFgetView().vGetPage(m_page_no);
Page page = m_doc.GetPage(m_page_no);
page.ObjsStart();
Matrix mat = v_page.CreateInvertMatrix(m_view.vGetX(), m_view.vGetY());
mat.TransformRect(rect);
page.AddAnnotRect(mat, rect, 3, 0x80FF0000, 0x800000FF);
mat.Destroy();
m_vPDF.PDFgetView().vRender(v_page);
m_vPDF.invalidate();

Please Log in or Create an account to join the conversation.

Eraser of PDF Ink 7 years 1 month ago #4893

  • el3ony
  • el3ony's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 16
  • Thank you received: 0
Sorry I just saw the rect it's showing at the bottom left so that's might be something wrong with the float[]rect and matrx ?

please look at the attachment.

Please Log in or Create an account to join the conversation.

Last edit: by McCloskey.

Eraser of PDF Ink 7 years 1 month ago #4894

  • el3ony
  • el3ony's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 16
  • Thank you received: 0
I try to print the log with this code

page.AddAnnotBitmap(bmAddnot, false, rect);
page.AddAnnotRect(mat, rect, 3, 0x80FF0000, 0x800000FF);

for (int i = 0; i < m_vPDF.PDFgetView().vGetPage(m_page_no).GetPage().GetAnnotCount(); i++) {
Annotation annot = m_vPDF.PDFgetView().vGetPage(m_page_no).GetPage().GetAnnot(i);
System.out.println(annot);
}

only one annototation show

rect is the only object showing on PDF but not Bitmap

what does this means?

Note: result of AddAnnotBitmap is always true

Please Log in or Create an account to join the conversation.

Eraser of PDF Ink 6 years 11 months ago #5701

  • bashirisonline
  • bashirisonline's Avatar
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 35
  • Karma: 1
  • Thank you received: 0
Any Success ??

Please Log in or Create an account to join the conversation.

Powered by Kunena Forum