首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >PDFTron mac实现

PDFTron mac实现
EN

Stack Overflow用户
提问于 2017-10-13 13:28:56
回答 1查看 180关注 0票数 1

我正在努力实现iOS和mac应用程序,它显示和编辑pdfs。

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

有经验的人使用他们的等效类的mac实现或建议mac实现?

代码语言:javascript
复制
#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;
}

非常感谢您的帮助。马蒂

EN

回答 1

Stack Overflow用户

发布于 2017-10-13 16:01:09

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

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

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

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/46731126

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档