小编Mik*_*ike的帖子

从uisplitview更改主视图和详细视图

在我的故事板上,我的项目以分割视图开始,自动分配我的自定义UITableViewController(嵌入在导航控制器中)作为详细视图控制器(由关系segue完成).如何从我的自定义访问拆分视图控件,UITableViewController以便我可以根据需要更改主视图控制器视图?

xcode objective-c ipad uisplitviewcontroller ios

4
推荐指数
1
解决办法
3469
查看次数

在iOS中将pdf转换为png会导致外观质量大幅降低

我正在将pdf文件转换为png图像,因此我可以将文本添加到png然后转换回pdf.我使用下面的代码转换为png.这导致外观质量的显着降低.有什么可以做的,以防止或尽量减少质量损失?

NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString *writeableDBPath = [documentsDirectory stringByAppendingPathComponent:@"sample.pdf"];

CFStringRef path;
CFURLRef url;

path = CFStringCreateWithCString (NULL, [writeableDBPath UTF8String], kCFStringEncodingUTF8);
url = CFURLCreateWithFileSystemPath (NULL, path, kCFURLPOSIXPathStyle, 0);

CGPDFDocumentRef myDocument;

myDocument = CGPDFDocumentCreateWithURL(url);

UIGraphicsBeginImageContext(CGSizeMake(612,792));
CGContextRef currentContext = UIGraphicsGetCurrentContext();

CGContextTranslateCTM(currentContext, 10, 792); //596,842 //640x960, 
CGContextScaleCTM(currentContext, 1.0, -1.0); // make sure the page is the right way up

CGPDFPageRef page = CGPDFDocumentGetPage (myDocument, 1); // first page of PDF is page 1 (not zero)
CGContextDrawPDFPage …
Run Code Online (Sandbox Code Playgroud)

pdf xcode cgcontext ios

0
推荐指数
1
解决办法
3128
查看次数

标签 统计

ios ×2

xcode ×2

cgcontext ×1

ipad ×1

objective-c ×1

pdf ×1

uisplitviewcontroller ×1