gpt4 book ai didi

iphone - 安全 pdf : locked/uneditable to prevent changes after generating from iOS device

转载 作者:搜寻专家 更新时间:2023-10-30 20:06:37 25 4
gpt4 key购买 nike

我正在使用 UIKit 框架在 iOS 设备中生成 pdf。我想知道我们是否可以锁定(提供安全性)生成的 pdf,以便在通过电子邮件发送或下载它之后,人们无法使用任何 pdf 可编辑工具进行编辑/修改。

最佳答案

是的——这是可能的。如果您使用 UIGraphicsBeginPDFContextToFile 开始创建 PDF,您可以向其发送一个字典,其中包含指定您想要的加密/锁定类型的选项。这是它的文档:

http://developer.apple.com/library/ios/#documentation/uikit/reference/UIKitFunctionReference/Reference/reference.html

这是一个创建它的例子:

NSDictionary * pdfInfo = nil;

if (trimmedPassPhrase && [trimmedPassPhrase length] > 0) {
pdfInfo = [NSDictionary dictionaryWithObjectsAndKeys:trimmedPassPhrase, kCGPDFContextOwnerPassword,
trimmedPassPhrase, kCGPDFContextUserPassword,
[NSNumber numberWithInt:128], kCGPDFContextEncryptionKeyLength, nil];
}


BOOL pdfContextSuccess = UIGraphicsBeginPDFContextToFile(newFilePath, CGRectZero, pdfInfo );

关于iphone - 安全 pdf : locked/uneditable to prevent changes after generating from iOS device,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10286732/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com