In one of my iPad application I have created PDF report and show it in web view and user can email that report to customer. Following code I have used for creating the report.
NSDictionary *dictionary = [[NSDictionary alloc] initWithObjectsAndKeys:@"owner", kCGPDFContextOwnerPassword, @"user", kCGPDFContextUserPassword, kCFBooleanFalse, kCGPDFContextAllowsCopying, kCFBooleanFalse, kCGPDFContextAllowsPrinting, nil];
UIGraphicsBeginPDFContextToFile(thefilePath, CGRectZero, dictionary);
Password protection is working fine for me.
But our requirement is, when user open that PDF file in web view in the application then It should not ask for Password. It will only ask for the password when user emailed that PDF file to customer and that customer tried to view it.
So I want to know whether there is any option so that we can open the PDF file by providing password programmatically inside the application when user view it in web view.
Thanks in Advance!!