如何在生成时为PDF文件设置密码所以用户在从电子邮件下载后用密码打开文件?任何帮助都会被appriecaited.thanks提前
答案 0 :(得分:1)
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);