美文网首页
iOS 绘制pdf

iOS 绘制pdf

作者: 花式写法 | 来源:发表于2021-04-09 17:25 被阅读0次

        //开启pdf上下文

        UIGraphicsBeginPDFContextToFile(path, self.view.bounds, nil)

        //开启新的一页后才可以绘制内容

        UIGraphicsBeginPDFPage()

        //绘制自己想绘制的内容

        image?.draw(in:self.view.bounds)

        //每次都开启新的一页

        UIGraphicsBeginPDFPage()

        image?.draw(in:self.view.bounds)

        UIGraphicsBeginPDFPage()

        image?.draw(in:self.view.bounds)

        //绘制结束关闭上下文

        UIGraphicsEndPDFContext()

相关文章

网友评论

      本文标题:iOS 绘制pdf

      本文链接:https://www.haomeiwen.com/subject/xlhwkltx.html