user2681789
user2681789

Reputation: 905

Set password for PDF file in IOS

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

Answers (1)

user4003752
user4003752

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

Related Questions