|
@@ -214,7 +214,7 @@
|
|
|
|
|
|
|
|
url=CFURLCreateWithFileSystemPath(NULL, path, kCFURLPOSIXPathStyle, 0);
|
|
url=CFURLCreateWithFileSystemPath(NULL, path, kCFURLPOSIXPathStyle, 0);
|
|
|
|
|
|
|
|
- CFBridgingRelease(path);
|
|
|
|
|
|
|
+ CFRelease(path);
|
|
|
// CGPDFCONTEXTCREATE
|
|
// CGPDFCONTEXTCREATE
|
|
|
|
|
|
|
|
|
|
|
|
@@ -236,38 +236,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-//
|
|
|
|
|
-// CFMutableDictionaryRef myDictionary = NULL;
|
|
|
|
|
-// myDictionary= CFDictionaryCreateMutable(NULL,
|
|
|
|
|
-// 0,
|
|
|
|
|
-// &kCFTypeDictionaryKeyCallBacks,
|
|
|
|
|
-// &kCFTypeDictionaryValueCallBacks);
|
|
|
|
|
-// // CFDictionarySetValue(myDictionary,
|
|
|
|
|
-// // kCGPDFContextTitle,
|
|
|
|
|
-// // CFSTR("Photo from iPrivate Album"));
|
|
|
|
|
-// // CFDictionarySetValue(myDictionary,
|
|
|
|
|
-// // kCGPDFContextCreator,
|
|
|
|
|
-// // CFSTR("iPrivate Album"));
|
|
|
|
|
-//
|
|
|
|
|
-// // //设置文档名称
|
|
|
|
|
-// // CFDictionarySetValue(myDictionary, kCGPDFContextTitle, CFSTR("My PDF File"));
|
|
|
|
|
-// // //设置创建者
|
|
|
|
|
-// // CFDictionarySetValue(myDictionary, kCGPDFContextCreator, CFSTR("My Name"));
|
|
|
|
|
-// //设置文档尺寸
|
|
|
|
|
-// CFDictionarySetValue(myDictionary, kCGPDFContextOwnerPassword, CFSTR("usai2010"));
|
|
|
|
|
-// CFDictionarySetValue(myDictionary, kCGPDFContextAllowsPrinting, kCFBooleanTrue);
|
|
|
|
|
-// CFDictionarySetValue(myDictionary, kCGPDFContextAllowsCopying, kCFBooleanFalse);
|
|
|
|
|
-//
|
|
|
|
|
-//
|
|
|
|
|
|
|
|
|
|
- pdfContext=CGPDFContextCreateWithURL(url, &docsize,nil);
|
|
|
|
|
|
|
+ CFMutableDictionaryRef myDictionary = NULL;
|
|
|
|
|
+ myDictionary= CFDictionaryCreateMutable(NULL,
|
|
|
|
|
+ 0,
|
|
|
|
|
+ &kCFTypeDictionaryKeyCallBacks,
|
|
|
|
|
+ &kCFTypeDictionaryValueCallBacks);
|
|
|
|
|
+ // CFDictionarySetValue(myDictionary,
|
|
|
|
|
+ // kCGPDFContextTitle,
|
|
|
|
|
+ // CFSTR("Photo from iPrivate Album"));
|
|
|
|
|
+ // CFDictionarySetValue(myDictionary,
|
|
|
|
|
+ // kCGPDFContextCreator,
|
|
|
|
|
+ // CFSTR("iPrivate Album"));
|
|
|
|
|
+
|
|
|
|
|
+ // //设置文档名称
|
|
|
|
|
+ // CFDictionarySetValue(myDictionary, kCGPDFContextTitle, CFSTR("My PDF File"));
|
|
|
|
|
+ // //设置创建者
|
|
|
|
|
+ // CFDictionarySetValue(myDictionary, kCGPDFContextCreator, CFSTR("My Name"));
|
|
|
|
|
+ //设置文档尺寸
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+ CFDictionarySetValue(myDictionary, kCGPDFContextOwnerPassword, CFSTR("usai2010"));
|
|
|
|
|
+ CFDictionarySetValue(myDictionary, kCGPDFContextAllowsPrinting, kCFBooleanTrue);
|
|
|
|
|
+ CFDictionarySetValue(myDictionary, kCGPDFContextAllowsCopying, kCFBooleanFalse);
|
|
|
|
|
+
|
|
|
|
|
+//
|
|
|
|
|
+
|
|
|
|
|
+ pdfContext=CGPDFContextCreateWithURL(url, &docsize,myDictionary);
|
|
|
|
|
+
|
|
|
|
|
+ CFRelease(myDictionary);
|
|
|
|
|
+ CFRelease(url);
|
|
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
size_t page_count=CGPDFDocumentGetNumberOfPages(document);
|
|
size_t page_count=CGPDFDocumentGetNumberOfPages(document);
|
|
|
- for(int i=1;i<=page_count;i++)
|
|
|
|
|
|
|
+ for(int i=1;i<=page_count*0;i++)
|
|
|
{
|
|
{
|
|
|
int p = (i+4)%5+1;
|
|
int p = (i+4)%5+1;
|
|
|
NSMutableDictionary* page_control=controlTemplate[[NSString stringWithFormat:@"page_%d",p-1]];
|
|
NSMutableDictionary* page_control=controlTemplate[[NSString stringWithFormat:@"page_%d",p-1]];
|
|
@@ -386,8 +390,7 @@
|
|
|
// CFBridgingRelease(page);
|
|
// CFBridgingRelease(page);
|
|
|
}
|
|
}
|
|
|
CGContextRelease(pdfContext);
|
|
CGContextRelease(pdfContext);
|
|
|
-// CFRelease(myDictionary);
|
|
|
|
|
- CFBridgingRelease(url);
|
|
|
|
|
|
|
+
|
|
|
|
|
|
|
|
// CFRelease(cfpdfAttributes);
|
|
// CFRelease(cfpdfAttributes);
|
|
|
// //开始画pdf
|
|
// //开始画pdf
|