ios - how to create multiple pages pdf programmatically in iPhone -


i have 1 image array , trying create pdf images.how can create multiple pages pdf file. checked 1 tutorial not working me. how create multiple page pdf in ios6? please me

this works me:

nsarray *pagearray = yourimagearray;  nsmutabledata *pdfdata = [nsmutabledata data]; uigraphicsbeginpdfcontexttodata(pdfdata, cgrectmake(0, 0, 595, 842), nil);  (uiimage *theimage in pagearray) {     uigraphicsbeginpdfpage();      nsdata *jpegdata = uiimagejpegrepresentation(theimage, 0.5);     cgdataproviderref dp = cgdataprovidercreatewithcfdata((__bridge cfdataref)jpegdata);     cgimageref cgimage = cgimagecreatewithjpegdataprovider(dp, null, true, kcgrenderingintentdefault);     [[uiimage imagewithcgimage:cgimage] drawinrect:cgrectmake(0, 0, theimage.size.width, theimage.size.height)]; }  uigraphicsendpdfcontext(); return pdfdata; 

Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -