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 #4871

  • el3ony
  • el3ony's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 16
  • Thank you received: 0
I have another problem with after I added and call vRender again it's disappear.
How can I add bitmap correctly with float[]

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

Eraser of PDF Ink 7 years 1 month ago #4872

  • radaee
  • radaee's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 1037
  • Karma: 43
  • Thank you received: 62
like this logic:
	rect[0] = bitmap_left_on_screen;
	rect[1] = bitmap_top_on_screen;
	rect[2] = bitmap_right_on_screen;
	rect[3] = bitmap_bottom_on_screen;
	PDFVPage vpage;
	Matrix mat = vpage.CreateInvertMatrix(m_view.vGetX(), m_view.vGetY());
	mat.TransformRect(rect);
	Page page = vpage.getPage();
	page.AddAnnotBitmap(bitmap, true, rect);//professional license is needed.

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

Eraser of PDF Ink 7 years 1 month ago #4873

  • el3ony
  • el3ony's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 16
  • Thank you received: 0
I cannot find TransformRect method from radaee Matrix. Can you give me this method ?

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

Eraser of PDF Ink 7 years 1 month ago #4874

  • radaee
  • radaee's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 1037
  • Karma: 43
  • Thank you received: 62
this method can be found in new version, and need new librdpdf.so library.
are you used new version?

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

Eraser of PDF Ink 7 years 1 month ago #4877

  • el3ony
  • el3ony's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 16
  • Thank you received: 0
Ok I got TransformRect from new sdk but I still cannot addAnnotBitmap

This is my code

float[] rect = new float[]{0, 0, getBitmap().getWidth(), getBitmap().getHeight()};
Matrix mat = m_ink_page.CreateInvertMatrix(m_view. vGetX(), m_view.vGetY());
mat.TransformRect(rect);
page.AddAnnotBitmap(m_ink.getBitmap(), true, rect);

Do I have to implement another code after AddAnnotBitmap?

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

Eraser of PDF Ink 7 years 1 month ago #4883

  • el3ony
  • el3ony's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 16
  • Thank you received: 0
Any update ?

Here I add some code that addAnnotBitmap but it doesn't work at all

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);
Matrix mat = v_page.CreateInvertMatrix(m_view.vGetX(), m_view.vGetY());
mat.TransformRect(rect);
page.AddAnnotBitmap(bmAddnot, true, rect);

but it doesn't show a bitmap after I added it

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

Powered by Kunena Forum