Signin/Signup with: 
Welcome, Guest
Username: Password: Remember me
Questions about Android development and PDF
  • Page:
  • 1

TOPIC:

Get and remove annotations programmatically 6 years 11 months ago #12389

  • iosDeveloper
  • iosDeveloper's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 4
  • Thank you received: 0
Hi there,

Is it possible to get list of annotations in a document, and remove them programmatically?

I believe this should be easily done, but I don't see any guides or examples that would help me to do it.

Thanks in advance!

Please Log in or Create an account to join the conversation.

Get and remove annotations programmatically 6 years 11 months ago #12395

  • nermeen
  • nermeen's Avatar
  • Offline
  • Platinum Member
  • Platinum Member
  • Posts: 962
  • Thank you received: 87
To get a list of the annotation in a document, you need to do a simple loop like the following:
for (int i = 0; i < m_doc.GetPageCount(); i++) {
	Page page = m_doc.GetPage(i);
	page.ObjsStart();
	for (int j = 0; j < page.GetAnnotCount(); j++) {
	Annotation annot = page.GetAnnot(j);
       //add it to your list
}
page.Close();
}
To remove an annotation:
Annotation.RemoveFromPage()

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
Powered by Kunena Forum