Is it possible to create a pdf with different page sizes in iOS - Objective C? -


i've done multiple times pdf pages @ same size. possible mixed sizes pdf on ios? (like example fixed width , multiple heights pages)

i'm finding lot of discordant answers around, , few data on platform-specific capabilities.

it has been easy adding every page different mediabox.

// start pdf file nsmutabledata *pdffile = [[nsmutabledata alloc] init]; cgdataconsumerref pdfconsumer = cgdataconsumercreatewithcfdata((cfmutabledataref)pdffile);  cgrect mediabox = cgrectmake(0, 0, pagesize.width, pagesize.height);     cgcontextref pdfcontext = cgpdfcontextcreate(pdfconsumer, &mediabox, null);  cgcontextbeginpage(pdfcontext, &mediabox);  cgcontextdrawimage(pdfcontext, imagebox, [image cgimage]); cgcontextendpage(pdfcontext);  // change mediabox  cgcontextbeginpage(pdfcontext, &mediabox); ... etc.... cgcontextendpage(pdfcontext);  // close pdf  cgcontextrelease(pdfcontext); cgdataconsumerrelease(pdfconsumer); 

Comments

Popular posts from this blog

how to insert data php javascript mysql with multiple array session 2 -

multithreading - Exception in Application constructor -

windows - CertCreateCertificateContext returns CRYPT_E_ASN1_BADTAG / 8009310b -