是否可以通过 iBook 打开下载的电子书文件?
我有一个问题,如果我可以下载电子书文件,例如 .epub 或 PDF,然后我在 tableview
上列出该文件,现在我选择其中一本书。
我可以通过 iBook 打开吗?
或者我需要实现一个阅读器来打开文件?
还有另一个问题,我在我的文件夹中下载了一个pdf文件
我将其注销的路径,看起来正确
这是代码:
NSString *docPath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES)objectAtIndex:0];
NSString *ePubSubFolder = [docPath stringByAppendingPathComponent:@"Books"];
NSString *pdfPath = [ePubSubFolder stringByAppendingPathComponent:[NSString stringWithFormat:@"%@",self.pdfFileName]];
CFURLRef pdfURL = CFURLCreateWithFileSystemPath (NULL,(CFStringRef)pdfPath, kCFURLPOSIXPathStyle, FALSE);
NSLog(@"PDF URL: %@", pdfURL);
pdf = CGPDFDocumentCreateWithURL((CFURLRef)pdfURL);
CFRelease(pdfURL);
日志结果是
../iPhone%20Simulator/4.3.2/Applications/06BA5929-3531-4AC3-B524-6CC74DC7E2C9/Documents/Books/Repeat%20After%20Me%20User's%20Guide.pdf
我做错了什么吗?我不会在我的视图上显示任何东西。
非常感谢您的所有回复或回答:-)
I got a question, which is, what if I can download a ebook file, eg .epub or PDF, then I list this file on a tableview
, now I select one of the books.
Can I open via iBook?
Or I need to implement a reader to open the file?
Also got another question , I download a pdf file in my folder
The path I log it out , looks right
Here is the code:
NSString *docPath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES)objectAtIndex:0];
NSString *ePubSubFolder = [docPath stringByAppendingPathComponent:@"Books"];
NSString *pdfPath = [ePubSubFolder stringByAppendingPathComponent:[NSString stringWithFormat:@"%@",self.pdfFileName]];
CFURLRef pdfURL = CFURLCreateWithFileSystemPath (NULL,(CFStringRef)pdfPath, kCFURLPOSIXPathStyle, FALSE);
NSLog(@"PDF URL: %@", pdfURL);
pdf = CGPDFDocumentCreateWithURL((CFURLRef)pdfURL);
CFRelease(pdfURL);
The log result is
../iPhone%20Simulator/4.3.2/Applications/06BA5929-3531-4AC3-B524-6CC74DC7E2C9/Documents/Books/Repeat%20After%20Me%20User's%20Guide.pdf
Do I did something wrong ?I won't show any thing on my view.
Many thanks for all reply or answer :-)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在IOS中,当您使用任何应用程序打开pdf时,您会在右上角看到一个选项,单击它,您可以看到诸如在ibooks中打开等选项。我已经在许多应用程序中尝试过此操作。
这就是我在我的 ios 设备上使用一些 pdf 所做的事情。将文件加载到 comp 上的 dropbox 文件夹中,在设备的 dropbox 中打开它,然后将其移至 ibooks 上。
in IOS when you open a pdf using any application you get an option on the top right corner click on it and you can see options like open in ibooks etc.. I have tried this with many apps.
this is what I do to use some pdf on my ios devices.. load the file into a dropbox folder on the comp open it in the device in dropbox and then move it over to ibooks..