简体   繁体   English

如何在iOS应用程序中编辑PDF文件?

[英]How can I edit PDF files in an iOS application?

In my iPhone / iPad application, I show a person's medical reports in the form of a PDF. 在我的iPhone / iPad应用程序中,我以PDF的形式显示了一个人的医疗报告。 I have saved the reports in the documents directory and am reading them from there. 我已将报告保存在文档目录中,并从那里读取它们。

I want the user to be able to add or edit comments on these PDFs, as well as be able to highlight certain sections in the PDF. 我希望用户能够在这些PDF上添加或编辑注释,以及能够突出显示PDF中的某些部分。 After editing, the application should be able to save the PDF back into the documents directory. 编辑后,应用程序应该能够将PDF保存回文档目录。

Is this possible within an iOS application? 这可能在iOS应用程序中吗? If so, how? 如果是这样,怎么样? Is this a task for Core Graphics? 这是Core Graphics的任务吗?

Editing PDF directly on iPad/iPhone is a rather big job because the standard API only supports showing it (and only a bit more.) If you want to do anything more, you need to invest a huge amount of time to implement generic pdf handling code. 直接在iPad / iPhone上编辑PDF是一项相当大的工作,因为标准API仅支持显示它(并且只需更多一点。)如果你想做更多的事情,你需要花费大量的时间来实现通用的pdf处理码。

There is an open-source library handling these, eg this one . 有一个处理这些的开源库,例如这个 I don't know if it fits your needs, though. 不过,我不知道它是否符合您的需求。

A better idea, in my opinion, is to create a native UI showing the data contained in the PDF file using the standard Cocoa-Touch UIKit and create the PDF once the user is done with it so that the user can export it back. 在我看来,更好的想法是使用标准Cocoa-Touch UIKit创建显示PDF文件中包含的数据的本机UI,并在用户完成后创建PDF,以便用户可以将其导出。 That way, you don't have to write a complicated PDF handling code. 这样,您就不必编写复杂的PDF处理代码。

In any case, it's not a good idea to show generic PDF on iPhone, because the screen size is so small (iPad is a different question, especially if you expect the user to be familiar with the particular format of your pdf.). 在任何情况下,在iPhone上显示通用PDF并不是一个好主意,因为屏幕尺寸太小(iPad是一个不同的问题,特别是如果您希望用户熟悉您的PDF格式的特定格式。)。 A dedicated UI would be much better. 专用UI会更好。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在ios应用程序中显示和编辑现有PDF文件 - How to show and edit existing PDF files in ios application 如何在iOS上编辑UIBezierPath中的点? - How can I edit point in UIBezierPath on iOS? 如何使用IOS应用程序的图形API或FQL编辑事件的数据,例如位置和地点? - how can i edit event's data like location and venue using graph api or fql for IOS Application? 添加到 iOS 主屏幕时,如何在 PWA 上下载动态生成的 PDF 文件? - How can I download dynamically generated PDF files on PWA when added to home screen on iOS? 我可以对iOS上生成的pdf文件中的图像使用JPEG压缩吗? - Can I use JPEG compression for images in pdf files generated on iOS? 如何使用任何第三方库在iOS应用程序中编辑现有pdf文档。 - How to edit an existing pdf document in an iOS application using any third party libraries. iOS如何在iOS App中显示下载的PDF? - iOS How can I display a downloaded PDF in an iOS App? 如何在同一 iOS 设备中将文件从一个应用程序传输到另一个应用程序? - How can I transfer files from one application to another in the same iOS device? 在iphone应用程序中编辑PDF - Edit PDF in iphone application 我们如何只能从Google Drive iOS获取文件夹和pdf文件 - How can we get only folders and pdf files from google drive ios
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM