iPhone - 使用文本和图像创建 PDF

发布于 2024-11-29 22:10:14 字数 293 浏览 4 评论 0原文

我在我的应用程序中输入了一些用户输入的文本,并且图像是从相机捕获的。 我想使用文本和图像创建 PDF? 我知道如何创建 PDF,如 URL PDF 创建

但我不知道如何使用文本和图像创建 PDF。 有人能给我推荐一些好的教程或一些示例代码吗?

I've some text entered by user in my app and image is captured from camera.
I want to create a PDF using the text and image?
I know how to create a PDF as mentioned in URL PDF Creation

But I don't know how to create a PDF using both text and image.
Can some one suggest me good tutorial or some sample piece of code?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

提笔书几行 2024-12-06 22:10:14

在您提到的链接中提供的示例行中,您可以执行类似的操作 -

CGContextSelectFont (pdfContext, "Arial", 12, kCGEncodingMacRoman);
CGContextSetTextDrawingMode (pdfContext, kCGTextFill);
CGContextSetRGBFillColor (pdfContext, 0, 0, 0, 1);
const char *text = "my text";
CGContextShowTextAtPoint (pdfContext, 50, 375, text, strlen(text)); //Display wherever you want to

您可以以类似的方式使用 CGContextDrawImage 来显示图像。

HTH,

阿克谢

On the lines of the example provided at the link you mentioned, you can do something like-

CGContextSelectFont (pdfContext, "Arial", 12, kCGEncodingMacRoman);
CGContextSetTextDrawingMode (pdfContext, kCGTextFill);
CGContextSetRGBFillColor (pdfContext, 0, 0, 0, 1);
const char *text = "my text";
CGContextShowTextAtPoint (pdfContext, 50, 375, text, strlen(text)); //Display wherever you want to

You can use CGContextDrawImage in a similar fashion to display the image.

HTH,

Akshay

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文