how to convert jpeg file to pdf file in iphone?
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:
- Load the JPEG file into a
UIImage
. - Create a new PDF context with
CGPDFContextCreate()
orCGPDFContextCreateWithURL()
. - Add a page to the PDF context with
CGPDFContextBeginPage()
. - 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.
- Call
CGPDFContextEndPage()
andCGPDFContextClose()
.
精彩评论