开发者

how to convert jpeg file to pdf file in iphone?

开发者 https://www.devze.com 2023-02-25 11:28 出处:网络
I want to convert jepg file into pdf file in an iphone application... Do anyon开发者_JS百科e know any link or tutorial or any idea about this?All you can do is load the image file and draw it into a

I want to convert jepg file into pdf file in an iphone application...

Do anyon开发者_JS百科e know any link or tutorial or any idea about this?


All you can do is load the image file and draw it into a newly created PDF context:

  1. Load the JPEG file into a UIImage.
  2. Create a new PDF context with CGPDFContextCreate() or CGPDFContextCreateWithURL().
  3. Add a page to the PDF context with CGPDFContextBeginPage().
  4. Draw the image into the PDF context. You will probably have to play a bit with the coordinate systems and the size of the image, depending on how you want the image to appear in the PDF.
  5. Call CGPDFContextEndPage() and CGPDFContextClose().
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号