Reputation: 905
How do i set password for PDF file while generating So the user open the file with password after downloading it from Email?any help will be appriecaited.thanks in advance
Upvotes: 0
Views: 745
Reputation:
CFDictionarySetValue(myDictionary, kCGPDFContextTitle, CFSTR("My PDF File"));
CFDictionarySetValue(myDictionary, kCGPDFContextCreator, CFSTR("My Name"));
///
CFDictionarySetValue(myDictionary, kCGPDFContextUserPassword, CFSTR("userpassword"));
CFDictionarySetValue(myDictionary, kCGPDFContextOwnerPassword, CFSTR("ownerpassword"));
///
pdfContext = CGPDFContextCreateWithURL (url, &pageRect, myDictionary);
Check this Creating Password Protected PDF in Objective-C
Upvotes: 1