http://blog.csdn.net/gnicky/article/details/7491902
https://github.com/Ink/ThatPDF
http://ipdfdev.com/2013/03/13/pdf-frameworks-and-tools-for-ios-and-mac-os-x/
===================
上回说到这个FastPDF还是不错的,至少用于demo学习,足以。下载:Download now FastPdfKit
FastPdfKit is available in 4 versions: Free, Basic, Plus and Extra, all availables throgh the public repository on github. 目前来说有4个版本,均可以在github得到下载
In the repository you'll find a sample Xcode project with many targets that you can customize based on your needs. To start you can try the static version distributed as framework (click here for project direct download) that will let you add pdf support in your applications with a single step. (通过添加静态库,然后使用的方式就可以通过简单的步骤让你的APP支持PDF,当然不是仅仅浏览了)
With the free version you can use every FastPdfKit features for an unlimited period. The single limitation is a Splash Screen with FastPdfKit logo when you open every pubblication.You can obviously use this version to distribute applications on the App Store, no limits. 使用免费版本,你能够得到所有FastPDFkit的特性,只不过需要看到一个弹出界面,同时你还可以使用free的版本,单发布到App store,这个是完全可以的。
http://fastpdfkit.com/ios-framework:
Precise zoom on annotations and page parts 这个算个feature,可以在批注上zoom//
Auto mode: single page in portrait and double page in landscape: 这个就自动布局,如果是landscape就双栏显示
Added a method to retrieve annotations from the document and provide them as overlays, 在2011的某个版本中,增加了获取批注并以overlay的方式呈现的功能:
在下载的代码中:
- MenuViewController *aMenuViewController = nil;
- f(UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
- aMenuViewController = [[MenuViewController alloc]initWithNibName:@"MenuView_pad" bundle:[NSBundle mainBundle]];
- else {
- aMenuViewController = [[MenuViewController alloc]initWithNibName:@"MenuView_phone" bundle:[NSBundle mainBundle]];
MenuViewController *aMenuViewController = nil; if(UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) { aMenuViewController = [[MenuViewController alloc]initWithNibName:@"MenuView_pad" bundle:[NSBundle mainBundle]]; } else { aMenuViewController = [[MenuViewController alloc]initWithNibName:@"MenuView_phone" bundle:[NSBundle mainBundle]]; }
要实现下面截图的功能,啥也不用干,采用一个readerview,再加一个documentmanager
基本步骤3steps:
1. 把下载得到的所有library和build信息,xcconfig,整个目录copy到你自己的项目中
2. 修改project configuration info,选择fastodfkitframework,
3,完成代码,调用vc,打开PDF文件
/** Present the pdf on screen in a modal view */
[selfpresentModalViewController:pdfViewController animated:YES];
ReaderVC->MFDocumentmanger->NSURL->DocumentName:
会自动把缩略图生成到目录下,且后续能够点击缩略图后关联navigate到特定page
/** Set resources folder on the manager */
documentManager.resourceFolder = thumbnailsPath;
==============
NSFileManager *manager = [NSFileManagerdefaultManager];
NSDirectoryEnumerator *direnum = [manager enumeratorAtPath:thumbnailsPath];
NSString *filename;
while ((filename = [direnum nextObject] )) {
NSLog(@"%@",filename);
}
=========
关于PDF缩略图,方法一直接从PDF文件中获取,方法二,自己利用一些方法产生(例如using quartz) ,然后保存下来:方法二:
-(UIImage*)imageFromPDFWithDocumentRef:(CGPDFDocumentRef)documentRef {
CGPDFPageRef pageRef =CGPDFDocumentGetPage(documentRef,1);
CGRect pageRect =CGPDFPageGetBoxRect(pageRef, kCGPDFCropBox);
UIGraphicsBeginImageContext(pageRect.size);
CGContextRef context =UIGraphicsGetCurrentContext();
CGContextTranslateCTM(context,CGRectGetMinX(pageRect),CGRectGetMaxY(pageRect));
CGContextScaleCTM(context,1,-1);
CGContextTranslateCTM(context,-(pageRect.origin.x),-(pageRect.origin.y));
CGContextDrawPDFPage(context, pageRef);
UIImage*finalImage =UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return finalImage;}
看另外一个代码,通过新起thread来处理,并且cache image:
However If you are targeting iOS 4 or above I would strongly recommend using blocks. (Also graphics contexts are thread safe since 4).
I found a significant performance increase when I generated thumbs with blocks.
What I have done in the past is:
-
Have a ViewController for your thumbs, it has a scrollview that has a content size appropriate for all your pages. Insert Placeholder ImageViews into is if you like.
-
On document load, kick off a thumb generator in the background (see code below)
-
The code below calls a method
drawImageView
that takes the index of the page, grabs the image from the disk and puts it into the scroll view -
If your feeling really motivated you can implement a render scope on the thumb scrollView (only rendering the thumbs you need to - something you should be doing for the pdf's anyway)
-
Dont forget to delete the thumbs when your done, unless you want to cache..
#define THUMB_SIZE 100,144
-(void)generateThumbsWithGCD
{
thumbQueue = dispatch_queue_create("thumbQueue",0);//thumbQueue = dispatch_queue_t
NSFileManager*fm =[NSFileManager defaultManager];
//good idea to check for previous thumb cache with NSFileManager here
CGSize thumbSize =CGSizeMake(THUMB_SIZE);
__block CGPDFPageRef myPageRef;
NSString*reqSysVer =@"4.0";
NSString*currSysVer =[[UIDevice currentDevice] systemVersion];
//need to handle ios versions < 4
if([currSysVer compare:reqSysVer options:NSNumericSearch]==NSOrderedAscending){NSLog(@"UIKIT MULTITHREADING NOT SUPPORTED!");return;}//thread/api saftey
dispatch_async(thumbQueue,^{
for(i=1; i<=_maxPages; i++){
//check if worker is valid (class member bool) for cancelations
myPageRef=[[PDFDocument sharedPDFDocument]getPageData:i];//pdfdocument is a singleton class
if(!myPageRef)return;
NSAutoreleasePool* pool =[[NSAutoreleasePool alloc] init];
NSString* imageName =[NSString stringWithFormat:@"%@thumb%i.png",documentName,i];
NSString* fullPathToFile = [thumbDocPath stringByAppendingPathComponent:imageName];
if(![fm fileExistsAtPath:fullPathToFile]){
//NSLog(@"Not there");
UIGraphicsBeginImageContext(thumbSize);//thread Safe in iOs4
CGContextRef context =UIGraphicsGetCurrentContext();//thread Safe in iOs4
CGContextTranslateCTM(context,0,144);
CGContextScaleCTM(context,0.15,-0.15);
CGContextDrawPDFPage(context, myPageRef);
UIImage* render =UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
NSData* imageData=UIImagePNGRepresentation(render);
if(imageData){
NSLog(@"WROTE TO:%@",fullPathToFile);
if(![imageData writeToFile:fullPathToFile atomically:NO])NSLog(@"ERROR: Thumb Didnt Save");//COMMENT OUT TO DISABLE WRITE
}
}
elseNSLog(@"Allready There! %@",fullPathToFile);
//update progress on thumb viewController if you wish here
[pool release];
dispatch_sync(dispatch_get_main_queue(),^{
[self drawImageView:i];
});
}
});
dispatch_release(thumbQueue);}
-(void) exampleAnnotation;{
NSURL* url =[NSURL fileURLWithPath:[self getPDFFileName]];
CGPDFDocumentRef document =CGPDFDocumentCreateWithURL((CFURLRef) url);// 2
size_t count =CGPDFDocumentGetNumberOfPages(document);// 3
if(count ==0)
{
NSLog(@"PDF needs at least one page");
return;
}
CGRect paperSize =CGRectMake(0.0,0.0,595.28,841.89);
UIGraphicsBeginPDFContextToFile([self getTempPDFFileName], paperSize,nil);
UIGraphicsBeginPDFPageWithInfo(paperSize,nil);
CGContextRef currentContext =UIGraphicsGetCurrentContext();
// flip context so page is right way up
CGContextTranslateCTM(currentContext,0, paperSize.size.height);
CGContextScaleCTM(currentContext,1.0,-1.0);
CGPDFPageRef page =CGPDFDocumentGetPage(document,1);// grab page 1 of the PDF
CGContextDrawPDFPage(currentContext, page);// draw page 1 into graphics context ---PDF内容
// flip context so annotations are right way up
CGContextScaleCTM(currentContext,1.0,-1.0);
CGContextTranslateCTM(currentContext,0,-paperSize.size.height);
[@"Example annotation" drawInRect:CGRectMake(100.0,100.0,200.0,40.0) withFont:[UIFont systemFontOfSize:18.0]];
UIGraphicsEndPDFContext();---- 完成PDFcontext
CGPDFDocumentRelease(document);}//这样的,应该无法提供查找功能的
I just switched over to Xcode 4 and I'm having trouble working with .xcconfig files for build settings. My targets that already had files assigned in Xcode 3 are all set up - a column titled Config.file shows up in the Levels view of Build Settings. But I can't figure out how to edit the columns in this view or where to put an .xcconfig file to attach it to a new target. I've looked online and haven't found an answer. Anybody know how to do this?
===
Pick File | New, choose Other and "Configuration Settings File", this gets you a new .xcconfig file.
Then click on the project on the upper left in the file browser (the same place where you get to build settings), click on the project again in the second-to-left panel, and click on the Info tab at the top of the inner panel.
There, you can choose "Based on Configuration File" for each of your targets for each of your configurations (debug, release, etc.)
相关推荐
FastPdf_Setup pdf快速查看工具,方便快速的打印功能,
急速pdf阅读器. 简单高效,无广告 欢迎下载~ 666 没有自启动
Fastpdf_Setup_20210511_200_3.exe
首先你的fastreport正常可用 替换源码文件到安装地址 C:\Program Files\FastReports\FastReport 4\Source... FileName:='1.pdf'; ShowDialog:=False; ShowProgress:=False; end; frxReport1.Export(frxPDFExport1);
Foxit Reader是一款知名的PDF阅读器,它为用户提供了高效、安全的方式来查看、打印和注解PDF文档。在本文中,我们将深入探讨这款软件的核心特点、功能以及如何安装和使用。 一、Foxit Reader的主要特点 1. 高效性...
本源码是一个计算机进程查看器源码,采用winform进行开发,实现了计算机的进程查看并关闭的功能,可查看本地电脑所有进程信息,并显示当前选取状态下进程的详细内容,包括进程名称、版本、路径、调用的模块等相关...
360网盘客户端_setup_6.6.0.1307