Pragmatically Remove Highlight - RadaeePDF.com
Signin/Signup with: 
Welcome, Guest
Username: Password: Remember me
13 Jul 2017
Microsoft has ended support for Windows Phone 8.1
Read More...
Questions about Android development and PDF
  • Page:
  • 1

TOPIC: Pragmatically Remove Highlight

Pragmatically Remove Highlight 3 years 4 months ago #7938

  • abhishekjaju
  • abhishekjaju's Avatar Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Posts: 40
  • Thank you received: 1
Is it possible to programmatically remove highlight from Screen.
We are saving Book and Page Number where highlight is saved.
If user want delete it from custom database table, can we remove highlight from front end PDF also.

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

Pragmatically Remove Highlight 3 years 4 months ago #7950

  • Davide
  • Davide's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 773
  • Karma: 16
  • Thank you received: 60
Hi,
you can loop this to remove all the Highlights:

Page page = m_pages[pcur].GetPage();
if( page != null )
{
Annotation annot = page.GetAnnot(annot_index);
annot.RemoveFromPage();
annot = null;
vRenderSync(m_pages[pcur]);
}

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

Pragmatically Remove Highlight 3 years 4 months ago #7951

  • abhishekjaju
  • abhishekjaju's Avatar Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Posts: 40
  • Thank you received: 1
My friend it will remove all highlight in the screen. If there are more than two highlight than we will end up removin user content.

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

Pragmatically Remove Highlight 3 years 4 months ago #7952

  • Davide
  • Davide's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 773
  • Karma: 16
  • Thank you received: 60
You can check with annot.GetType() if the type of the annotation is 9 (text highlight) and delete only them. www.androidpdf.mobi/documentation/javado...ation.html#GetType()

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

Pragmatically Remove Highlight 3 years 4 months ago #7953

  • radaee
  • radaee's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 830
  • Karma: 43
  • Thank you received: 10
this is for 1 page.
as all pages, need a loop.

Page page = m_pages[pcur].GetPage();
if( page != null )
{
int cur = page.GetAnnotCount() - 1;
while(cur >= 0)
{
if( annot.GetType() == MARKUP_HIGHLIGHT )
{
Annotation annot = page.GetAnnot(cur);
annot.RemoveFromPage();
annot = null;
}
cur--;
}
vRenderSync(m_pages[pcur]);
}

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

  • Page:
  • 1
Powered by Kunena Forum