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

TOPIC:

Need to delete all annotation of particular type like rectangle or oval. 4 years 4 months ago #14788

  • apdeveloper
  • apdeveloper's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
  • Posts: 67
  • Thank you received: 0
Dear Team,
I want to delete all annotation of particular type whenever i am opening the pdf suppose i have added rectangle,oval and ink annotation on pdf and now again when i open the pdf i want to delete all the rectangle annotation but other should remain.

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

Need to delete all annotation of particular type like rectangle or oval. 4 years 4 months ago #14793

  • federico
  • federico's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 261
  • Thank you received: 18
Hi,
Rectangle, ellipse and ink have the type value so you can delete just rect annots by type using:
-(int)type;
in PDFObjc class.

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

Last edit: by federico.

Need to delete all annotation of particular type like rectangle or oval. 4 years 4 months ago #14798

  • apdeveloper
  • apdeveloper's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
  • Posts: 67
  • Thank you received: 0
Dear Team,
You didn't get my question whenever i open the pdf i want to delete all rectangle and other should remain.

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

Need to delete all annotation of particular type like rectangle or oval. 4 years 4 months ago #14800

  • federico
  • federico's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 261
  • Thank you received: 18
Hi,
You should process every annots of certain page in a cycle, then check annots by type value and delete them
In your case, rect annot's type has 5 as value.

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

Last edit: by federico.

Need to delete all annotation of particular type like rectangle or oval. 4 years 4 months ago #14801

  • radaee
  • radaee's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 1123
  • Thank you received: 73
Hi,
do you mean following codes?
int pg_cnt = [doc pageCount];
int pg_num = 0;
for(pg_num = 0; pg_num < pg_cnt; pg_num++)
{
  PDFPage *pg = [doc page:pg_num];
  [pg ObjsStart];
  int annot_cnt = [page annotCount];
  int annot_num;
  for(annot_num = 0; annot_num < annot_cnt; annot_num++)
  {
    PDFAnnot *annot = [pg annotAtIndex:annot_num];
    int atype = [annot type];
    if(atype == 5 || atype == 6)//rectangle and oval
    {
      [annot removeFromPage];
      annot_num--;
      annot_cnt--;
    }
  }
  [pg Close];
}

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

Last edit: by radaee.

Need to delete all annotation of particular type like rectangle or oval. 4 years 4 months ago #14809

  • apdeveloper
  • apdeveloper's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
  • Posts: 67
  • Thank you received: 0
Dear Team,

What is annot type for note .

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

  • Page:
  • 1
  • 2
Powered by Kunena Forum