我尝试使用这里给出的信息
但它真的很模糊......
我也尝试使用这个代码使用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)