Hi,
Actually, It takes time when we make the file flatten.
To make file flatten, we removed all the annotations in the file by using library function 'vAnnotRemove'.
But, Before removing checkbox or dropdownlist annotation, we draw the images for them.
We have written following code before removing dropdownlist annot
float pageHeight = self.contentSize.height / m_doc.pageCount;
CGRect mrkupRect = CGRectMake([vpage ToDIBX:annotRect.left], [vpage ToDIBY:annotRect.bottom] + (pageHeight * pageno), [vpage ToDIBX:annotRect.right] - [vpage ToDIBX:annotRect.left], [vpage ToDIBY:annotRect.top] - [vpage ToDIBY:annotRect.bottom]);
UIImageView *mrkupView2 =
UIImageView alloc] initWithImage:[UIImage imageNamed:mrkupRect.size.width < 10 ? @"checkboxsmallest.png" : @"checkbox.png";
mrkupView2.frame = mrkupRect;
mrkupView2.backgroundColor = [UIColor clearColor];
PDFMatrix *m = [[PDFMatrix alloc] init:fabsf(annotRect.left - annotRect.right) :fabsf(annotRect.top - annotRect.bottom) :annotRect.left :annotRect.top];
[thisContent gsCatMatrix:m];
[self addSubview:mrkupView2];
NSString *imgPath = [self createImageFromUIView:mrkupView2 withName:@"bullet"];
PDFDocImage *annotImage = [m_doc newImageJPEG:imgPath];
PDF_PAGE_IMAGE pgImage = [page addResImage:annotImage];
[thisContent drawImage:pgImage];
[page addContent:thisContent :YES];
[mrkupView2 removeFromSuperview];
and then [self vAnnotRemove];
Please suggest the changes or modification required in the above function to make the execution fast.
Also find attached file which takes time to save when we make it flatten.