Microsoft Windows Phone 8.1 support ends (13 Jul 2017)

Microsoft has ended support for Windows Phone 8.1

Questions about Android development and PDF

Pragmatically Remove Highlight

More
IP: 192.168.0.71 11 years 3 months ago #7938 by abhishekjaju
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.
More
IP: 192.168.0.122 11 years 3 months ago #7950 by Davide
Hi,
you can loop this to remove all the Highlights:

Code:
Page page = m_pages[pcur].GetPage(); if( page != null ) { Annotation annot = page.GetAnnot(annot_index); annot.RemoveFromPage(); annot = null; vRenderSync(m_pages[pcur]); }
More
IP: 192.168.0.71 11 years 3 months ago #7951 by abhishekjaju
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.
More
IP: 192.168.0.122 11 years 3 months ago #7952 by Davide
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()
More
IP: 192.168.0.71 11 years 3 months ago #7953 by radaee
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]);
}
Time to create page: 0.406 seconds
Powered by Kunena Forum