Ich bin Rendering eine pdf durch ein PDF-Kontext zu schaffen und es einen Weg geben, wie unten definiert:iphone pdf zu Dokumentenspeicher speichern
NSFileManager *fileManager = [NSFileManager defaultManager];
NSString *docsDirectory = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0];
NSString *file = [docsDirectory stringByAppendingPathComponent:@"mypdf.pdf"];
Und dann mit diesen Pfad wie folgt aus:
char * fileutf8 = [file UTF8String];
CGContextRef pdfContext;
CFStringRef path;
CFURLRef url;
CFMutableDictionaryRef myDictionary = NULL;
path = CFStringCreateWithCString (NULL, fileutf8,kCFStringEncodingUTF8);
url = CFURLCreateWithFileSystemPath (NULL, path,kCFURLPOSIXPathStyle, 0);
CFRelease (path);
myDictionary = CFDictionaryCreateMutable(NULL, 0,&kCFTypeDictionaryKeyCallBacks,&kCFTypeDictionaryValueCallBacks);
CFDictionarySetValue(myDictionary, kCGPDFContextTitle, CFSTR("My PDF File"));
CFDictionarySetValue(myDictionary, kCGPDFContextCreator, CFSTR("My Name"));
pdfContext = CGPDFContextCreateWithURL (url, &size, myDictionary);
CFRelease(url);
CFRelease(myDictionary);// rendering code follows
Lange Rede kurzer Sinn Ich kann nicht sehen, ob das PDF gut aussieht, weil ich es nicht in iTunes unter dem Bereich File Sharing finde. Fehle ich etwas?
Dieser UIFileSharingEnabled-Parameter war nützlich, dank Mate. –