1

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

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

4

1 回答 1

1

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

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类似的方式来显示图像。

高温下,

阿克谢

于 2011-08-16T07:25:44.233 回答