在 iOS 中的 pdf 中添加签名图像(尤其适用于 iPhone/iPad)
随着 iOS 对 Quartz 2D 的支持及其对 PDF 格式的支持;向 pdf 添加签名图像应该更容易一些。我环顾四周,发现人们正在使用 PDFKit、UIView 或 Core Graphic Library。哪个是最简单且推荐的库?另外,有推荐库的简单示例吗?当我试图了解 Quartz 2D 是如何工作的时,我所能找到的只是关于它如何工作的叙述性解释以及您可能使用的具体方法,但没有完整的示例。你知道“你好世界”这个词。不管怎样,我是 iOS 开发新手,但编写代码已经有 20 多年了,所以我也许也能选择这个操作系统。
一些可怜的灵魂可以怜悯我并请为我指明正确的方向吗?
With the iOS support for Quartz 2D and its support for the PDF format; should adding a signature image to a pdf be a little easier. I have looked all over and saw people are using the PDFKit, UIView or Core Graphic Library. Which is the easiest and the recommended library for the effort? Also, are there simple examples of the recommend library. When I tried to see how Quartz 2D worked, all I could find are narrative explanations about how it worked and specific method you may use but no complete examples. You know the hello world one. Anyway, I am new to iOS development but been writing code for over 20 years so I might be able to pick this OS up as well.
Can some poor soul have pity on me and please point me in the right direction?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我通过在视图上加载旧的 pdf 文件,然后在该视图上添加签名,然后渲染视图来完成此操作。检查以下帖子
将签名图像添加到 pdf 中,而不向 iOS 中的用户显示 pdf 数据
但无法创建包含带有签名“不显示在视图”的现有 pdf 的 pdf。
I have done this by loading the old pdf file on view and then add signature on that view and then render the view. check the following post
Add a signature image to a pdf without showing the pdf data to user in iOS
But not able create the pdf which contain existing pdf with signature "without showing on view" .
现在回答这个问题已经太晚了。但让我为将来可能遇到这个问题的人提供一些指导。
这篇文章很好地总结了 iOS 中的 PDF 处理。对于初学者来说很好。
http://www.ioslearner.com/generate-pdf-programmatically -iphoneipad/#more-242
这个也类似,但不是很详尽。 http://www.absoluteripple.com/ 1/post/2012/03/generate-pdf-in-ios.html
上面的链接没有讨论处理现有的 PDF。我发现这个 stackoverflow 答案对此非常有用。
将 pdf 页面添加到现有 pdf Objective-c
请注意,如果您想操作现有的 PDF,Quartz 2d 是您的最佳选择。
另请参阅 CGPDFDocument、CGPDFPage、CGPDFContext 和 CGContext 的参考页面。
It's too late to answer this question now. But let me just provide some pointers for people who may bump into this question in future.
This one summarizes PDF handling in iOS pretty well. Good for starters.
http://www.ioslearner.com/generate-pdf-programmatically-iphoneipad/#more-242
This one is also similar, but not very exhaustive. http://www.absoluteripple.com/1/post/2012/03/generating-pdf-in-ios.html
The above links do not talk about handling existing PDFs. I found this stackoverflow answer really useful for that.
Add pdf page to an existing pdf objective-c
Just a note, if you want manipulate existing PDFs, Quartz 2d is the way to go.
Also look at reference pages of CGPDFDocument, CGPDFPage, CGPDFContext and CGContext.