How can I create a PDF file programmatically in an iOS application?

前端 未结 4 1009
Happy的楠姐
Happy的楠姐 2020-12-05 11:48

How to generate a PDF file on a user action?

4条回答
  •  清歌不尽
    2020-12-05 12:33

    As an example of creating a PDF from the contents of a CALayer, you can refer to the -dataForPDFRepresentationOfLayer method within the CPLayer class in the Core Plot framework. You can do something similar to extract the content from a CALayer-backed UIView, although we had to subclass CALayer in order to get vector elements to render to a PDF properly.

提交回复
热议问题