2016-06-30 64 views
1

我正在尝试为SWIFT中的iOS开发应用程序,该应用程序需要呈现阿拉伯语PDF文件并允许用户通过从左向右滑动来阅读PDF。已经尝试了很多图书馆,但没有找到一个完美的方式来做到这一点。可以请任何图书馆或想法帮助我。 在此先感谢适用于iOS的PDF阅读器,支持从左到右分页支持

+0

你找到PDF库支持阿拉伯语刷卡由左到右? –

回答

0

尝试M3PDFKITvfr。我用M3PDFKIT,可以滑动到右侧和左侧

+0

为什么要投票?我使用它,它的工作原理 – xmhafiz

+0

嗨是否有可能从左到右滑动而不是从右到左浏览页面之间还具有分页效果。如上所述,我需要显示阿拉伯文PDF需要从左侧滑动到右侧 – MobX

1

嗨,我刚刚创建使用https://github.com/vfr/Reader迅捷的项目,你需要做以下步骤实现这一目标库转换中迅速:

  • 首先,你需要创建一个Bridge头文件放入你的swift项目中。
  • 然后你需要添加VFR所需的文件到你的项目(这将在我的示例代码附后)
  • 现在你需要设置import语句中桥头文件

#ifndef Bridge_Header_h

#define Bridge_Header_h

#import "ReaderViewController.h"

#endif /* Bridge_Header_h */

  • 添加此桥文件中工程 - >靶>构建设置 - > Objective-C的桥接报头,并设置Bridge文件。
  • 现在Opne项目视图控制器从您想打开PDF组委派文件,如:

class ViewController: UIViewController , ReaderViewControllerDelegate { 

而且它的视图控制器的viewDidLoad代码:

override func viewDidLoad() { 
     super.viewDidLoad() 
     let filepath = (NSBundle.mainBundle().pathForResource("Reader", ofType:"pdf"))! as String 

     if let document = ReaderDocument.withDocumentFilePath(filepath, password: "") 
     { 
      let readerViewController: ReaderViewController = ReaderViewController(readerDocument: document) 
      readerViewController.delegate = self 
      // Set the ReaderViewController delegate to self 
      self.navigationController!.pushViewController(readerViewController, animated: true) 
     } 
    } 

示例代码:https://github.com/nitingohel/NGSwiftPdfReader

实时输出:

enter image description here

+0

嗨是否有可能从左到右滑动,而不是从右到左浏览页面之间还具有分页效果。如上所述,我需要显示一个阿拉伯文PDF需要从左到右滑动 – MobX