- Posts: 40
- Thank you received: 1
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
- abhishekjaju
- Topic Author
- Offline
- Senior Member
-
Less
More
IP: 192.168.0.71
11 years 3 months ago #7938
by abhishekjaju
Pragmatically Remove Highlight was created 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.
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.
IP: 192.168.0.122
11 years 3 months ago #7950
by Davide
Replied by Davide on topic Pragmatically Remove Highlight
Hi,
you can loop this to remove all the Highlights:
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]);
}
- abhishekjaju
- Topic Author
- Offline
- Senior Member
-
Less
More
- Posts: 40
- Thank you received: 1
IP: 192.168.0.71
11 years 3 months ago #7951
by abhishekjaju
Replied by abhishekjaju on topic Pragmatically Remove Highlight
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.
IP: 192.168.0.122
11 years 3 months ago #7952
by Davide
Replied by Davide on topic Pragmatically Remove Highlight
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()
IP: 192.168.0.71
11 years 3 months ago #7953
by radaee
Replied by radaee on topic Pragmatically Remove Highlight
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]);
}
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