【问题标题】:PDFTron mac implementationPDFTron mac 实现
【发布时间】:2017-10-13 13:28:56
【问题描述】:

我正在实现显示和编辑 pdf 的 iOS 和 mac 应用程序。

  • 使用下面提供的代码完成了 iOS 版本的实现。
  • 问题是mac版本,它不包含显示和编辑pdf所需的PTPDFViewCtrl和ToolManager类。

任何人有使用他们的等效类进行 mac 实现或建议的 mac 实现的经验吗?

#pragma mark - PDFKit
-(void)initialConfig {

#warning MISSING PDFTRon license key
  // initialize PDFNet
  [PTPDFNet Initialize:@""];

  PTPDFViewCtrl *ctrl = [PTPDFViewCtrl new];
  CGFloat offset = 20;
  ctrl.frame = CGRectMake(0, offset, self.view.frame.size.width, self.view.frame.size.height - offset);
  [ctrl SetBackgroundColor:0 g:0 b:0 a:0];
  [ctrl SetHighlightFields:YES];
self.view.backgroundColor = [UIColor lightGrayColor];
  [self.view addSubview:ctrl];

  // open the PDF document included in the bundle in the PTPDFViewCtrl
  PTPDFDoc *doc = [[PTPDFDoc alloc]initWithFilepath:self.viewModel.getFilePath];
  [ctrl SetDoc:doc];
  self.viewModel.doc = doc;

  [ctrl setAutoresizingMask:UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth];

  // add the toolmanager (used to implement text selection, annotation editing, etc.
  ToolManager *toolManager = [[ToolManager alloc] initWithPDFViewCtrl:ctrl];
  [toolManager changeTool:[PanTool self]];
  ctrl.toolDelegate = toolManager;
}

非常感谢您的帮助。 马蒂

【问题讨论】:

    标签: objective-c macos pdftron


    【解决方案1】:

    出于演示目的,我们的 PDFNetCMac C/C++ 下载中包含一个 Java SWING 示例项目,但该示例未维护,也不支持。它使用 PDFView 类,并展示了一些集成的基础知识。示例不支持例如注解。

    同样,有一个 C++ Windows MFC 示例,一些客户将其用作与 Qt 等跨平台框架集成的指南。

    另一种选择是使用 PDF WebViewer,这需要将您的用户界面移动到本机 macOS 应用程序中的浏览器元素中,但 WebViewer 包含完整的查看体验,包括表单填写和注释。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-10-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多