Print Page | Close Window

Unable to remove annotations

Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: General Discussion
Forum Description: Discussion board for Debenu Quick PDF Library and Debenu PDF Viewer SDK
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=3422
Printed Date: 02 May 24 at 10:14PM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: Unable to remove annotations
Posted By: lakkan
Subject: Unable to remove annotations
Date Posted: 16 Dec 16 at 7:22AM
Hi,Cry

I am using following piece of code to remove all annotations from the selected page. Though it deletes all annotations from selected page, but sticky note annotations are still present on the page. Any help on this please..
QP.SelectPage(1);
int nAnnotCount = QP.AnnotationCount();
for(int nIndex=1; nIndex<=nAnnotCount; nIndex++)
{
int nRetVal  = QP.DeleteAnnotation(nIndex);
}

Lakkan



Replies:
Posted By: tfrost
Date Posted: 16 Dec 16 at 11:40AM
It does not completely explain the symptoms you describe, but the direction of your loop is incorrect.

For deletions, you should normally start with the last item and decrement the index.  Otherwise the deletion of item 1 will change the index in all the later items, and the deletion will fail when the index exceeds the number of items remaining.


Posted By: lakkan
Date Posted: 28 Dec 16 at 9:07AM
Thanks for your information. I did as you said, it worked.

Lakkan.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.01 - http://www.webwizforums.com
Copyright ©2001-2014 Web Wiz Ltd. - http://www.webwiz.co.uk