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

TOPIC:

Takes too much time to save file with dropdowns 8 years 10 months ago #9043

  • bhagyashree
  • bhagyashree's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 20
  • Thank you received: 0
If pdf file have many drop down list then it taken much time to save file.

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

Takes too much time to save file with dropdowns 8 years 10 months ago #9047

  • emanuele
  • emanuele's Avatar
  • Offline
  • User is blocked
  • User is blocked
  • Posts: 580
  • Thank you received: 67
Hi,
can you share the pdf used for this test?

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

Takes too much time to save file with dropdowns 8 years 10 months ago #9049

  • bhagyashree
  • bhagyashree's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 20
  • Thank you received: 0
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.

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

Last edit: by bhagyashree.

Takes too much time to save file with dropdowns 8 years 10 months ago #9056

  • support
  • support's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 692
  • Thank you received: 59
There is no attachment.

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

Takes too much time to save file with dropdowns 8 years 9 months ago #9179

  • bhagyashree
  • bhagyashree's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 20
  • Thank you received: 0
Hello,
Actually we cannot share the attachments as these are the actual files used.
If you take a pdf with multiple drop-downs, you will be able to reproduce the issue.
Please do the needful.

Thanks!

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

  • Page:
  • 1
Powered by Kunena Forum