小编Kus*_*ush的帖子

在Objective-C中创建受密码保护的PDF

我尝试使用这里给出的信息

https://developer.apple.com/library/mac/#documentation/graphicsimaging/conceptual/drawingwithquartz2d/dq_pdf/dq_pdf.html#//apple_ref/doc/uid/TP30001066-CH214-TPXREF101

但它真的很模糊......

我也尝试使用这个代码使用UIKit ...文件被创建..但它是0 kb ..无法写入任何数据..

BOOL allowCopy=YES;
BOOL allowPrint=YES;
//NSString *password=@"test";

CGContextRef pdfContext; //our pdfContext

CFStringRef path;

CFURLRef url;

CGRect pageRect = CGRectMake(0, 0,500, 500);

NSString *fileName=@"Test.pdf";
// CFStringRef passwordString = (__bridge_retained CFStringRef)password;

const char *filename = [fileName UTF8String];

// Create a CFString from the filename we provide to this method when we call it
path = CFStringCreateWithCString (NULL, filename, kCFStringEncodingUTF8);

// Create a CFURL using the CFString we just defined
url = CFURLCreateWithFileSystemPath (NULL, path, kCFURLPOSIXPathStyle, 0); …
Run Code Online (Sandbox Code Playgroud)

pdf passwords objective-c xcode4.2

5
推荐指数
1
解决办法
2975
查看次数

标签 统计

objective-c ×1

passwords ×1

pdf ×1

xcode4.2 ×1