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

More
IP: 192.168.0.71 8 years 7 months ago #12682 by glzlaohuai
hi, I want to hide or remove all the annotations in a pdf file. My code is below:
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); } } }
My question is that GetAnnot(annitationIndex) sometimes return null, so how can I remove or hide all the annotations in a pdf file, thanks
More
IP: 192.168.0.71 8 years 7 months ago - 8 years 7 months ago #12683 by nermeen
You need to first call
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); } } }
If you still have problems, can you please share the pdf file and they way you are calling the above code?
Last edit: 8 years 7 months ago by nermeen.
More
IP: 192.168.0.71 8 years 7 months ago #12684 by glzlaohuai
OK, thanks, I have a try.
More
IP: 192.168.0.71 8 years 7 months ago #12685 by glzlaohuai
it works, thank you. :woohoo:
More
IP: 45.77.124.47 7 years 10 months ago #13793 by 军罗
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
Powered by Kunena Forum