PDF generation using data

前端 未结 2 1829
再見小時候
再見小時候 2021-01-16 03:57

In my iPhone application, I have several data items. I want to generate a PDF file using these data items and attach the PDF file in email. What I know, I need to use Quartz

2条回答
  •  一个人的身影
    2021-01-16 04:02

    Here is a good (working) example of the CGPDF functions: http://www.olivetoast.com/blog/hamish/simple_uiscrollview_catiledlayer_example.ot

    It uses a CATiledLayer + UIScrollView, this may not be appropriate for a reader of sorts, but it still shows you how to load and draw a PDF doc without UIWebView (which severely restricts your abilities).

    Change the layer type back to a layer, add in page handling using CGPDFDocumentGetNumberOfPages and then CGPDFDocumentGetPage and you have a pretty good reader.

    I don't know how to perform annotations, I suspect you would need your own data structure on top of the document.

提交回复
热议问题