2011-08-16 39 views
1

我在用戶輸入的文本中輸入了一些文字,圖像是從相機拍攝的。 我想使用文本和圖像創建一個PDF? 我知道如何創建PDF中提到的URL PDF CreationiPhone - 使用文本和圖像創建PDF

但我不知道如何使用文本和圖像創建PDF。 可以有人建議我很好的教程或一些示例代碼?

回答

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以類似的方式來顯示圖像。

HTH,

阿克沙伊