- Posts: 67
- 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 iOS development and PDF
Need to delete all annotation of particular type like rectangle or oval.
- apdeveloper
- Topic Author
- Offline
- User is blocked
-
Less
More
IP: 114.143.252.148
6 years 11 months ago #14788
by apdeveloper
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.
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.
IP: 37.183.44.177
6 years 11 months ago - 6 years 11 months ago #14793
by federico
Replied by federico on topic Need to delete all annotation of particular type like rectangle or oval.
Hi,
Rectangle, ellipse and ink have the type value so you can delete just rect annots by type using:
in PDFObjc class.
Rectangle, ellipse and ink have the type value so you can delete just rect annots by type using:
Code:
-(int)type;
Last edit: 6 years 11 months ago by federico.
- apdeveloper
- Topic Author
- Offline
- User is blocked
-
Less
More
- Posts: 67
- Thank you received: 0
IP: 114.143.252.148
6 years 11 months ago #14798
by apdeveloper
Replied by apdeveloper on topic Need to delete all annotation of particular type like rectangle or oval.
Dear Team,
You didn't get my question whenever i open the pdf i want to delete all rectangle and other should remain.
You didn't get my question whenever i open the pdf i want to delete all rectangle and other should remain.
IP: 212.97.62.176
6 years 11 months ago - 6 years 11 months ago #14800
by federico
Replied by federico on topic Need to delete all annotation of particular type like rectangle or oval.
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.
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.
Last edit: 6 years 11 months ago by federico.
IP: 111.196.244.148
6 years 11 months ago - 6 years 11 months ago #14801
by radaee
Replied by radaee on topic Need to delete all annotation of particular type like rectangle or oval.
Hi,
do you mean following codes?
do you mean following codes?
Code:
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];
}
Last edit: 6 years 11 months ago by radaee.
- apdeveloper
- Topic Author
- Offline
- User is blocked
-
Less
More
- Posts: 67
- Thank you received: 0
IP: 114.143.255.84
6 years 11 months ago #14809
by apdeveloper
Replied by apdeveloper on topic Need to delete all annotation of particular type like rectangle or oval.
Dear Team,
What is annot type for note .
What is annot type for note .
Time to create page: 0.420 seconds