RadaeePDF.com :: Topic: Pragmatically Remove Highlight (1/1)
Welcome, Guest
Username: Password: Remember me

Signin/Signup with:

Questions about Android development and PDF

TOPIC: Pragmatically Remove Highlight

Pragmatically Remove Highlight 2 years 9 months ago #7938

  • abhishekjaju
  • abhishekjaju's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 40
  • Thank you received: 1
  • Karma: 0
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.
The administrator has disabled public write access.

Pragmatically Remove Highlight 2 years 9 months ago #7950

  • Davide
  • Davide's Avatar
  • OFFLINE
  • Moderator
  • Posts: 678
  • Thank you received: 47
  • Karma: 14
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]);
}
The administrator has disabled public write access.

Pragmatically Remove Highlight 2 years 9 months ago #7951

  • abhishekjaju
  • abhishekjaju's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 40
  • Thank you received: 1
  • Karma: 0
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.
The administrator has disabled public write access.

Pragmatically Remove Highlight 2 years 9 months ago #7952

  • Davide
  • Davide's Avatar
  • OFFLINE
  • Moderator
  • Posts: 678
  • Thank you received: 47
  • Karma: 14
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()
The administrator has disabled public write access.

Pragmatically Remove Highlight 2 years 9 months ago #7953

  • radaee
  • radaee's Avatar
  • OFFLINE
  • Moderator
  • Posts: 825
  • Thank you received: 10
  • Karma: 43
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]);
}
The administrator has disabled public write access.
Powered by Kunena Forum