【问题标题】:Is there a way to password protect PDFs exported from an iOS app?有没有办法对从 iOS 应用程序导出的 PDF 进行密码保护?
【发布时间】:2011-11-24 23:27:13
【问题描述】:

我们正在编写一个应用程序,我已经编写了将数据导出为 PDF 格式的代码。

问题是数据很敏感,需要保护,有没有办法使用苹果库对从应用程序导出的 PDF 进行密码保护?

如果没有,还有其他建议吗?

【问题讨论】:

    标签: objective-c ios pdf


    【解决方案1】:

    CGPDFContextCreate 采用一个字典,您可以在其中发送密码作为属性之一。

    您可以在 Apple 的参考文档中找到 CGPDFContxtCreate 的详细信息:

    http://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CGPDFContext/Reference/reference.html#//apple_ref/c/func/CGPDFContextCreate

    您可以在此处的 Apple 文档中找到密码设置信息:

    http://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CGPDFContext/Reference/reference.html#//apple_ref/doc/constant_group/Auxiliary_Dictionary_Keys

    【讨论】:

    • 请注意,UIGraphicsBeginPDFContext[...] 方法采用相同的字典(尽管是 NSDictionary* 而不是 CFDictionaryRef),供喜欢使用 Objective-C 对应方法的人使用。
    • 链接已断开
    猜你喜欢
    • 1970-01-01
    • 2012-07-30
    • 2013-08-05
    • 1970-01-01
    • 2014-04-08
    • 1970-01-01
    • 2020-07-18
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多