- Posts: 4
- Thank you received: 0
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
how to hide all the annotations in a pdf file
- glzlaohuai
- Topic Author
- Offline
- New Member
-
Less
More
IP: 192.168.0.71
8 years 7 months ago #12682
by glzlaohuai
how to hide all the annotations in a pdf file was created by glzlaohuai
hi, I want to hide or remove all the annotations in a pdf file. My code is below:
My question is that GetAnnot(annitationIndex) sometimes return null, so how can I remove or hide all the annotations in a pdf file, thanks
Code:
Document doc = PDFGetDoc();
int pageCount = doc.GetPageCount();
for (int i = 0; i < pageCount; i++) {
Page page = doc.GetPage(i);
int annCount = page.GetAnnotCount();
for (int j = 0; j < annCount; j++) {
Annotation annotation = page.GetAnnot(j);
if (annotation != null) {
annotation.SetHide(true);
}
}
}
IP: 192.168.0.71
8 years 7 months ago - 8 years 7 months ago #12683
by nermeen
Replied by nermeen on topic how to hide all the annotations in a pdf file
You need to first call
If you still have problems, can you please share the pdf file and they way you are calling the above code?
Code:
Page.ObjsStart
Code:
Document doc = PDFGetDoc();
int pageCount = doc.GetPageCount();
for (int i = 0; i < pageCount; i++) {
Page page = doc.GetPage(i);
page.ObjsStart();
int annCount = page.GetAnnotCount();
for (int j = 0; j < annCount; j++) {
Annotation annotation = page.GetAnnot(j);
if (annotation != null) {
annotation.SetHide(true);
}
}
}
Last edit: 8 years 7 months ago by nermeen.
- glzlaohuai
- Topic Author
- Offline
- New Member
-
Less
More
- Posts: 4
- Thank you received: 0
IP: 192.168.0.71
8 years 7 months ago #12684
by glzlaohuai
Replied by glzlaohuai on topic how to hide all the annotations in a pdf file
OK, thanks, I have a try.
- glzlaohuai
- Topic Author
- Offline
- New Member
-
Less
More
- Posts: 4
- Thank you received: 0
IP: 192.168.0.71
8 years 7 months ago #12685
by glzlaohuai
Replied by glzlaohuai on topic how to hide all the annotations in a pdf file
it works, thank you. :woohoo:
IP: 45.77.124.47
7 years 10 months ago #13793
by 军罗
Replied by 军罗 on topic how to hide all the annotations in a pdf file
it doesn't work here。https://www.radaeepdf.com/forum/Android-development/4067-how-to-hide-a-button-of-mutilmedia-in-pdf-file
Time to create page: 0.748 seconds