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

TOPIC:

Pragmatically Remove Highlight 9 years 4 months ago #7938

  • abhishekjaju
  • abhishekjaju's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
  • 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 9 years 4 months ago #7950

  • Davide
  • Davide's Avatar
  • Offline
  • User is blocked
  • User is blocked
  • Posts: 814
  • Thank you received: 65
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 9 years 4 months ago #7951

  • abhishekjaju
  • abhishekjaju's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
  • 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 9 years 4 months ago #7952

  • Davide
  • Davide's Avatar
  • Offline
  • User is blocked
  • User is blocked
  • Posts: 814
  • Thank you received: 65
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 9 years 4 months ago #7953

  • radaee
  • radaee's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 1123
  • Thank you received: 73
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